diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs index 05e27c3b589e2..0143ba5e5f86b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// ApplicationGatewaysOperations operations. @@ -35,13 +33,16 @@ internal partial class ApplicationGatewaysOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ApplicationGatewaysOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -70,12 +70,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Gets the specified application gateway. /// /// /// The name of the resource group. @@ -89,10 +88,22 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -102,11 +113,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -120,40 +131,40 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -170,10 +181,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -181,7 +192,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -189,10 +200,23 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -211,13 +235,31 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -226,8 +268,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The Get ApplicationGateway operation retrieves information about the - /// specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. @@ -235,30 +276,63 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Lists all application gateways in a resource group. + /// + /// + /// The name of the resource group. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (applicationGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -270,42 +344,40 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -322,10 +394,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -333,7 +405,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -347,14 +419,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -376,7 +448,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -389,9 +461,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -409,77 +481,36 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Gets all the application gateways in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (applicationGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -490,44 +521,39 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("applicationGatewayName", applicationGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -543,17 +569,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -561,7 +581,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -569,20 +589,20 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -604,7 +624,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -612,32 +632,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -655,32 +657,121 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the application gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Stops the specified application gateway in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets the backend health of the specified application gateway in a resource + /// group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync( + resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Deletes the specified application gateway. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (applicationGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -692,40 +783,42 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("applicationGatewayName", applicationGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -742,10 +835,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -753,7 +846,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -761,22 +854,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -796,31 +881,13 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -829,25 +896,61 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Creates or updates the specified application gateway. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (applicationGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -858,39 +961,44 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("applicationGatewayName", applicationGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -906,11 +1014,17 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -918,7 +1032,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -926,20 +1040,20 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -961,7 +1075,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -969,14 +1083,32 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -994,32 +1126,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -1033,6 +1140,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1046,11 +1162,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1067,37 +1183,37 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1114,10 +1230,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1125,7 +1241,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1136,7 +1252,12 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1170,32 +1291,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginStopWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -1209,6 +1305,15 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1222,11 +1327,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1243,37 +1348,37 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginStop", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1290,10 +1395,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1301,7 +1406,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1312,7 +1417,12 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1346,36 +1456,8 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the application gateway. - /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginBackendHealthWithHttpMessagesAsync( - resourceGroupName, applicationGatewayName, expand, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The name of the resource group. @@ -1393,6 +1475,18 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1406,11 +1500,11 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1428,41 +1522,41 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginBackendHealth", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{applicationGatewayName}", Uri.EscapeDataString(applicationGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{applicationGatewayName}", System.Uri.EscapeDataString(applicationGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (expand != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1479,10 +1573,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1490,7 +1584,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1504,14 +1598,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1546,9 +1640,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1566,8 +1660,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1578,6 +1671,18 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1604,25 +1709,25 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1639,10 +1744,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1650,7 +1755,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1664,14 +1769,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1706,9 +1811,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1726,8 +1831,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1738,6 +1842,18 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1764,25 +1880,25 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1799,10 +1915,10 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1810,7 +1926,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1824,14 +1940,14 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1866,9 +1982,9 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1887,3 +2003,4 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs index 47e4c97e3359e..a78bd394c71f0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ApplicationGatewaysOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ApplicationGatewaysOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ApplicationGatewaysOperationsExtensions { /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -37,12 +35,11 @@ public static partial class ApplicationGatewaysOperationsExtensions /// public static void Delete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).DeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).DeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -62,8 +59,7 @@ public static void Delete(this IApplicationGatewaysOperations operations, string } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Gets the specified application gateway. /// /// /// The operations group for this extension method. @@ -74,14 +70,13 @@ public static void Delete(this IApplicationGatewaysOperations operations, string /// /// The name of the application gateway. /// - public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).GetAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ApplicationGateway operation deletes the specified application - /// gateway. + /// Gets the specified application gateway. /// /// /// The operations group for this extension method. @@ -95,14 +90,16 @@ public static void BeginDelete(this IApplicationGatewaysOperations operations, s /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get ApplicationGateway operation retrieves information about the - /// specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -113,14 +110,16 @@ public static void BeginDelete(this IApplicationGatewaysOperations operations, s /// /// The name of the application gateway. /// - public static ApplicationGateway Get(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Parameters supplied to the create or update application gateway operation. + /// + public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).GetAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get ApplicationGateway operation retrieves information about the - /// specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -131,19 +130,22 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -151,19 +153,13 @@ public static ApplicationGateway Get(this IApplicationGatewaysOperations operati /// /// The name of the resource group. /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway operation - /// - public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) + public static IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).CreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -171,72 +167,47 @@ public static ApplicationGateway CreateOrUpdate(this IApplicationGatewaysOperati /// /// The name of the resource group. /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway operation - /// - public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) + public static IPage ListAll(this IApplicationGatewaysOperations operations) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ApplicationGateway operation creates/updates a ApplicationGateway + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -244,14 +215,16 @@ public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOp /// /// The name of the resource group. /// - public static IPage List(this IApplicationGatewaysOperations operations, string resourceGroupName) + /// + /// The name of the application gateway. + /// + public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -259,50 +232,57 @@ public static IPage List(this IApplicationGatewaysOperations /// /// The name of the resource group. /// + /// + /// The name of the application gateway. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IApplicationGatewaysOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// + public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IApplicationGatewaysOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -313,14 +293,18 @@ public static IPage ListAll(this IApplicationGatewaysOperati /// /// The name of the application gateway. /// - public static void Start(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// + public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -331,17 +315,23 @@ public static void Start(this IApplicationGatewaysOperations operations, string /// /// The name of the application gateway. /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in backend + /// health. + /// /// /// The cancellation token. /// - public static async Task StartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.StartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -352,14 +342,13 @@ public static void Start(this IApplicationGatewaysOperations operations, string /// /// The name of the application gateway. /// - public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + public static void BeginDelete(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Start ApplicationGateway operation starts application gateway in the - /// specified resource group through Network resource provider. + /// Deletes the specified application gateway. /// /// /// The operations group for this extension method. @@ -373,14 +362,13 @@ public static void BeginStart(this IApplicationGatewaysOperations operations, st /// /// The cancellation token. /// - public static async Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -391,14 +379,16 @@ public static void BeginStart(this IApplicationGatewaysOperations operations, st /// /// The name of the application gateway. /// - public static void Stop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + /// + /// Parameters supplied to the create or update application gateway operation. + /// + public static ApplicationGateway BeginCreateOrUpdate(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).StopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Creates or updates the specified application gateway. /// /// /// The operations group for this extension method. @@ -409,17 +399,22 @@ public static void Stop(this IApplicationGatewaysOperations operations, string r /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway operation. + /// /// /// The cancellation token. /// - public static async Task StopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.StopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -430,14 +425,13 @@ public static void Stop(this IApplicationGatewaysOperations operations, string r /// /// The name of the application gateway. /// - public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) + public static void BeginStart(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStartAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The STOP ApplicationGateway operation stops application gateway in the - /// specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The operations group for this extension method. @@ -451,14 +445,13 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The cancellation token. /// - public static async Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginStartAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); + await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -469,18 +462,13 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The name of the application gateway. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// - public static ApplicationGatewayBackendHealth BackendHealth(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string)) + public static void BeginStop(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName) { - return Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BackendHealthAsync(resourceGroupName, applicationGatewayName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IApplicationGatewaysOperations)s).BeginStopAsync(resourceGroupName, applicationGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Stops the specified application gateway in a resource group. /// /// /// The operations group for this extension method. @@ -491,24 +479,17 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str /// /// The name of the application gateway. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in backend - /// health. - /// /// /// The cancellation token. /// - public static async Task BackendHealthAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginStopAsync(this IApplicationGatewaysOperations operations, string resourceGroupName, string applicationGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BackendHealthWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginStopWithHttpMessagesAsync(resourceGroupName, applicationGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -529,8 +510,8 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str } /// - /// The BackendHealth operation gets the backend health of application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a resource + /// group. /// /// /// The operations group for this extension method. @@ -557,8 +538,7 @@ public static void BeginStop(this IApplicationGatewaysOperations operations, str } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -572,8 +552,7 @@ public static IPage ListNext(this IApplicationGatewaysOperat } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The operations group for this extension method. @@ -593,8 +572,7 @@ public static IPage ListNext(this IApplicationGatewaysOperat } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. @@ -608,8 +586,7 @@ public static IPage ListAllNext(this IApplicationGatewaysOpe } /// - /// The List ApplicationGateway operation retrieves all the application - /// gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The operations group for this extension method. @@ -630,3 +607,4 @@ public static IPage ListAllNext(this IApplicationGatewaysOpe } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index 8f8d22caaaa15..fd66038bc4346 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteCircuitAuthorizationsOperations operations. @@ -35,13 +33,16 @@ internal partial class ExpressRouteCircuitAuthorizationsOperations : IServiceOpe /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,8 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli public NetworkManagementClient Client { get; private set; } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -73,12 +74,11 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, authorizationName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -95,10 +95,22 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -112,11 +124,11 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -131,41 +143,41 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -182,10 +194,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -193,7 +205,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -201,10 +213,23 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -223,13 +248,31 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -238,8 +281,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } /// - /// The GET authorization operation retrieves the specified authorization from - /// the specified ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The name of the resource group. @@ -250,16 +292,57 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The name of the authorization. /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all authorizations in an express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the circuit. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -269,15 +352,11 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (authorizationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -290,43 +369,41 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("authorizationName", authorizationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -343,10 +420,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -354,7 +431,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -368,14 +445,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -397,7 +474,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -410,9 +487,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -430,8 +507,8 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -442,53 +519,25 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, circuitName, authorizationName, authorizationParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -502,15 +551,11 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); } - if (authorizationParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -524,43 +569,42 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("authorizationName", authorizationName); - tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{authorizationName}", Uri.EscapeDataString(authorizationName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -576,17 +620,11 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; - if(authorizationParameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(authorizationParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -594,7 +632,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -602,22 +640,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -637,49 +667,13 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -688,14 +682,20 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// Headers that will be added to request. @@ -703,10 +703,22 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -716,11 +728,19 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (authorizationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationName"); + } + if (authorizationParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authorizationParameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -733,41 +753,44 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("authorizationName", authorizationName); + tracingParameters.Add("authorizationParameters", authorizationParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{authorizationName}", System.Uri.EscapeDataString(authorizationName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -783,11 +806,17 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; + if(authorizationParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(authorizationParameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -795,7 +824,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -803,20 +832,20 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -838,7 +867,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -846,14 +875,32 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -871,8 +918,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -883,6 +929,18 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -909,25 +967,25 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -944,10 +1002,10 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -955,7 +1013,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -969,14 +1027,14 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1011,9 +1069,9 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1032,3 +1090,4 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs index 2c3a3b979e835..fafae6709630e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteCircuitAuthorizationsOperations. @@ -23,8 +22,8 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteCircuitAuthorizationsOperationsExtensions { /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -40,12 +39,12 @@ public static partial class ExpressRouteCircuitAuthorizationsOperationsExtension /// public static void Delete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -68,8 +67,7 @@ public static void Delete(this IExpressRouteCircuitAuthorizationsOperations oper } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -83,14 +81,13 @@ public static void Delete(this IExpressRouteCircuitAuthorizationsOperations oper /// /// The name of the authorization. /// - public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete authorization operation deletes the specified authorization - /// from the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -107,14 +104,16 @@ public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The GET authorization operation retrieves the specified authorization from - /// the specified ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -128,14 +127,17 @@ public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations /// /// The name of the authorization. /// - public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// + public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The GET authorization operation retrieves the specified authorization from - /// the specified ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -149,20 +151,23 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth /// /// The name of the authorization. /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -171,23 +176,15 @@ public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuth /// The name of the resource group. /// /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// The name of the circuit. /// - public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + public static IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -196,29 +193,22 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute /// The name of the resource group. /// /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation + /// The name of the circuit. /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -232,18 +222,14 @@ public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRoute /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation - /// - public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) + public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Authorization operation creates/updates an authorization in the - /// specified ExpressRouteCircuits + /// Deletes the specified authorization from the specified express route + /// circuit. /// /// /// The operations group for this extension method. @@ -257,24 +243,16 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuitAuthorization - /// operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -283,16 +261,22 @@ public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpress /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - public static IPage List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName) + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// + public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route circuit. /// /// /// The operations group for this extension method. @@ -301,22 +285,28 @@ public static IPage List(this IExpressRouteCir /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -330,8 +320,7 @@ public static IPage ListNext(this IExpressRout } /// - /// The List authorization operation retrieves all the authorizations in an - /// ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The operations group for this extension method. @@ -352,3 +341,4 @@ public static IPage ListNext(this IExpressRout } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs index 4cbda14678001..281211912838d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteCircuitPeeringsOperations operations. @@ -35,13 +33,16 @@ internal partial class ExpressRouteCircuitPeeringsOperations : IServiceOperation /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The name of the resource group. @@ -73,12 +73,11 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, peeringName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The name of the resource group. @@ -95,10 +94,22 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -112,11 +123,11 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -131,41 +142,41 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -182,10 +193,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -193,7 +204,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -201,10 +212,23 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -223,13 +247,31 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -238,8 +280,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } /// - /// The GET peering operation retrieves the specified authorization from the - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The name of the resource group. @@ -250,16 +291,57 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The name of the peering. /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all peerings in a specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -269,15 +351,11 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (peeringName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -290,43 +368,41 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -343,10 +419,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -354,7 +430,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -368,14 +444,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -397,7 +473,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -410,9 +486,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -430,41 +506,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route circuit. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, peeringParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Deletes the specified peering from the specified express route circuit. /// /// /// The name of the resource group. @@ -475,20 +517,25 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The name of the peering. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -502,15 +549,11 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (peeringParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -524,43 +567,42 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -576,17 +618,11 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(peeringParameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(peeringParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -594,7 +630,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -602,22 +638,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -637,49 +665,13 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -688,14 +680,20 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// Headers that will be added to request. @@ -703,10 +701,22 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -716,11 +726,19 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (peeringParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -733,41 +751,44 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("peeringParameters", peeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -783,11 +804,17 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(peeringParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -795,7 +822,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -803,20 +830,20 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -838,7 +865,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -851,9 +878,27 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -871,8 +916,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -883,6 +927,18 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -909,25 +965,25 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -944,10 +1000,10 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -955,7 +1011,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -969,14 +1025,14 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1011,9 +1067,9 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1032,3 +1088,4 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs index cd56ff2f3840c..55b658fbd637a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitPeeringsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteCircuitPeeringsOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteCircuitPeeringsOperationsExtensions { /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -40,12 +38,11 @@ public static partial class ExpressRouteCircuitPeeringsOperationsExtensions /// public static void Delete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).DeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).DeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -68,8 +65,7 @@ public static void Delete(this IExpressRouteCircuitPeeringsOperations operations } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -83,14 +79,13 @@ public static void Delete(this IExpressRouteCircuitPeeringsOperations operations /// /// The name of the peering. /// - public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).GetAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete peering operation deletes the specified peering from the - /// ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -107,14 +102,16 @@ public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations opera /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The GET peering operation retrieves the specified authorization from the - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -128,14 +125,17 @@ public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations opera /// /// The name of the peering. /// - public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// + public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).GetAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The GET peering operation retrieves the specified authorization from the - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -149,20 +149,23 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp /// /// The name of the peering. /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -173,21 +176,13 @@ public static ExpressRouteCircuitPeering Get(this IExpressRouteCircuitPeeringsOp /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation - /// - public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + public static IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -198,27 +193,19 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -232,18 +219,13 @@ public static ExpressRouteCircuitPeering CreateOrUpdate(this IExpressRouteCircui /// /// The name of the peering. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation - /// - public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) + public static void BeginDelete(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Peering operation creates/updates an peering in the specified - /// ExpressRouteCircuits + /// Deletes the specified peering from the specified express route circuit. /// /// /// The operations group for this extension method. @@ -257,24 +239,16 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC /// /// The name of the peering. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit Peering - /// operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -283,16 +257,22 @@ public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteC /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - public static IPage List(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName) + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. + /// + public static ExpressRouteCircuitPeering BeginCreateOrUpdate(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route circuits. /// /// /// The operations group for this extension method. @@ -301,22 +281,28 @@ public static IPage List(this IExpressRouteCircuitPe /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit peering + /// operation. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitPeeringsOperations operations, string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -330,8 +316,7 @@ public static IPage ListNext(this IExpressRouteCircu } /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The operations group for this extension method. @@ -352,3 +337,4 @@ public static IPage ListNext(this IExpressRouteCircu } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs index be7704660d72f..26840a95ae0a4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteCircuitsOperations operations. @@ -35,13 +33,16 @@ internal partial class ExpressRouteCircuitsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,14 +51,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -70,18 +70,17 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, circuitName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of express route circuit. /// /// /// Headers that will be added to request. @@ -89,10 +88,22 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -102,11 +113,11 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -120,40 +131,40 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -170,10 +181,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -181,7 +192,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -189,10 +200,23 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -211,13 +235,31 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -226,8 +268,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The Get ExpressRouteCircuit operation retrieves information about the - /// specified ExpressRouteCircuit. + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -235,16 +276,147 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The name of the circuit. /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, circuitName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync( + resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all the stats from an express route circuit in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -254,11 +426,11 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -272,40 +444,40 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -322,10 +494,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -333,7 +505,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -347,14 +519,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -376,7 +548,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -389,9 +561,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -409,44 +581,16 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, circuitName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Gets all stats from an express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// + /// The name of the peering. /// /// /// Headers that will be added to request. @@ -454,10 +598,22 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -467,15 +623,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (parameters == null) + if (peeringName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -488,42 +644,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("peeringName", peeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -539,17 +696,11 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -557,7 +708,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -565,20 +716,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -600,7 +751,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -608,32 +759,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -651,85 +784,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (circuitName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); - } - if (peeringName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); - } - if (devicePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -741,46 +832,40 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -797,10 +882,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -808,7 +893,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -816,20 +901,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -851,7 +936,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -862,107 +947,58 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (circuitName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); - } - if (peeringName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); - } - if (devicePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -973,47 +1009,39 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1030,10 +1058,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1041,7 +1069,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1049,20 +1077,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1084,7 +1112,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1097,9 +1125,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1117,52 +1145,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync( - resourceGroupName, circuitName, peeringName, devicePath, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// /// /// Headers that will be added to request. @@ -1170,10 +1159,19 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1183,19 +1181,11 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (peeringName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); - } - if (devicePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1208,45 +1198,41 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); - tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{devicePath}", Uri.EscapeDataString(devicePath)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1263,10 +1249,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1274,7 +1260,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1282,22 +1268,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1317,31 +1295,13 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1350,8 +1310,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -1359,16 +1318,32 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The name of the circuit. /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1378,11 +1353,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); } - if (this.Client.ApiVersion == null) + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1395,41 +1374,42 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStats", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1445,11 +1425,17 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1457,7 +1443,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1465,20 +1451,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1500,7 +1486,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1508,14 +1494,32 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1533,28 +1537,43 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// + /// + /// The path of the device. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1568,11 +1587,15 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (this.Client.ApiVersion == null) + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1586,42 +1609,44 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("circuitName", circuitName); tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPeeringStats", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{circuitName}", Uri.EscapeDataString(circuitName)); - _url = _url.Replace("{peeringName}", Uri.EscapeDataString(peeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1638,10 +1663,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1649,7 +1674,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1657,20 +1682,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1692,7 +1717,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1705,9 +1730,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1725,32 +1750,65 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1762,40 +1820,46 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1812,10 +1876,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1823,7 +1887,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1831,20 +1895,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1866,7 +1930,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1879,9 +1943,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1899,25 +1963,65 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (circuitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "circuitName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1928,39 +2032,47 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{circuitName}", System.Uri.EscapeDataString(circuitName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{devicePath}", System.Uri.EscapeDataString(devicePath)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1977,10 +2089,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1988,7 +2100,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1996,20 +2108,20 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2031,7 +2143,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2044,9 +2156,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2064,8 +2176,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -2076,6 +2187,18 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -2102,25 +2225,25 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2137,10 +2260,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -2148,7 +2271,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -2162,14 +2285,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2204,9 +2327,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2224,8 +2347,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -2236,6 +2358,18 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -2262,25 +2396,25 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2297,10 +2431,10 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -2308,7 +2442,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -2322,14 +2456,14 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2364,9 +2498,9 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2385,3 +2519,4 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs index 6c577972bd8ba..5d301fb8da0e2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteCircuitsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteCircuitsOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteCircuitsOperationsExtensions { /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -33,16 +31,15 @@ public static partial class ExpressRouteCircuitsOperationsExtensions /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// public static void Delete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).DeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).DeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -51,7 +48,7 @@ public static void Delete(this IExpressRouteCircuitsOperations operations, strin /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The cancellation token. @@ -62,47 +59,7 @@ public static void Delete(this IExpressRouteCircuitsOperations operations, strin } /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route Circuit. - /// - public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) - { - Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the express route Circuit. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); - } - - /// - /// The Get ExpressRouteCircuit operation retrieves information about the - /// specified ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The operations group for this extension method. @@ -111,7 +68,7 @@ public static void BeginDelete(this IExpressRouteCircuitsOperations operations, /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of express route circuit. /// public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { @@ -119,8 +76,7 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera } /// - /// The Get ExpressRouteCircuit operation retrieves information about the - /// specified ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The operations group for this extension method. @@ -129,7 +85,7 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of express route circuit. /// /// /// The cancellation token. @@ -143,7 +99,7 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -155,7 +111,8 @@ public static ExpressRouteCircuit Get(this IExpressRouteCircuitsOperations opera /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) { @@ -163,7 +120,7 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -175,7 +132,8 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The cancellation token. @@ -189,7 +147,8 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -198,18 +157,22 @@ public static ExpressRouteCircuit CreateOrUpdate(this IExpressRouteCircuitsOpera /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// + /// The name of the peering. /// - public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -218,26 +181,28 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create/delete ExpressRouteCircuit operation + /// + /// The name of the peering. + /// + /// + /// The path of the device. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -246,7 +211,7 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -254,15 +219,14 @@ public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuits /// /// The path of the device. /// - public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -271,7 +235,7 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -282,18 +246,17 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// /// The cancellation token. /// - public static async Task ListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -302,7 +265,7 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -310,15 +273,14 @@ public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressR /// /// The path of the device. /// - public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the ExpressRouteCircuits - /// in a resource group. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -327,7 +289,7 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -338,18 +300,16 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// /// The cancellation token. /// - public static async Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -358,23 +318,15 @@ public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExp /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// - public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetStatsAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -383,29 +335,21 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// /// /// The cancellation token. /// - public static async Task ListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -414,23 +358,18 @@ public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IEx /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -439,29 +378,24 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// - /// - /// The path of the device. - /// /// /// The cancellation token. /// - public static async Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -469,24 +403,13 @@ public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(thi /// /// The name of the resource group. /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. - /// - public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -494,30 +417,47 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// /// The name of the resource group. /// - /// - /// The name of the circuit. + /// + /// The cancellation token. /// - /// - /// The name of the peering. + public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. /// - /// - /// The path of the device. + public static IPage ListAll(this IExpressRouteCircuitsOperations operations) + { + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all the express route circuits in a subscription. + /// + /// + /// The operations group for this extension method. /// /// /// The cancellation token. /// - public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -526,23 +466,15 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult ListRoutesTableSu /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// - public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) + public static void BeginDelete(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves the - /// currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Deletes the specified express route circuit. /// /// /// The operations group for this extension method. @@ -551,28 +483,18 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// /// /// The cancellation token. /// - public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -583,14 +505,17 @@ public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTa /// /// The name of the circuit. /// - public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName) + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// + public static ExpressRouteCircuit BeginCreateOrUpdate(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetStatsAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Creates or updates an express route circuit. /// /// /// The operations group for this extension method. @@ -601,20 +526,24 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat /// /// The name of the circuit. /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// /// /// The cancellation token. /// - public static async Task GetStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetStatsWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -623,19 +552,22 @@ public static ExpressRouteCircuitStats GetStats(this IExpressRouteCircuitsOperat /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// - public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName) + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).GetPeeringStatsAsync(resourceGroupName, circuitName, peeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List stats ExpressRouteCircuit operation retrieves all the stats from - /// a ExpressRouteCircuits in a resource group. + /// Gets the currently advertised ARP table associated with the express route + /// circuit in a resource group. /// /// /// The operations group for this extension method. @@ -644,25 +576,28 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// + /// + /// The path of the device. + /// /// /// The cancellation token. /// - public static async Task GetPeeringStatsAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginListArpTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetPeeringStatsWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -670,14 +605,23 @@ public static ExpressRouteCircuitStats GetPeeringStats(this IExpressRouteCircuit /// /// The name of the resource group. /// - public static IPage List(this IExpressRouteCircuitsOperations operations, string resourceGroupName) + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the express + /// route circuit in a resource group. /// /// /// The operations group for this extension method. @@ -685,50 +629,82 @@ public static IPage List(this IExpressRouteCircuitsOperatio /// /// The name of the resource group. /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginListRoutesTableAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IExpressRouteCircuitsOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath) { - return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IExpressRouteCircuitsOperations)s).BeginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets the currently advertised routes table summary associated with the + /// express route circuit in a resource group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IExpressRouteCircuitsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCircuitsOperations operations, string resourceGroupName, string circuitName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -742,8 +718,7 @@ public static IPage ListNext(this IExpressRouteCircuitsOper } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The operations group for this extension method. @@ -763,8 +738,7 @@ public static IPage ListNext(this IExpressRouteCircuitsOper } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The operations group for this extension method. @@ -778,8 +752,7 @@ public static IPage ListAllNext(this IExpressRouteCircuitsO } /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The operations group for this extension method. @@ -800,3 +773,4 @@ public static IPage ListAllNext(this IExpressRouteCircuitsO } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs index f7fc1783e4c92..de50388bc5a26 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteServiceProvidersOperations operations. @@ -35,13 +33,16 @@ internal partial class ExpressRouteServiceProvidersOperations : IServiceOperatio /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// Headers that will be added to request. @@ -59,16 +59,28 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -83,35 +95,35 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -128,10 +140,10 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -139,7 +151,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -153,14 +165,14 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -195,9 +207,9 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -215,8 +227,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The NextLink from the previous successful call to List operation. @@ -227,6 +238,18 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -253,25 +276,25 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -288,10 +311,10 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -299,7 +322,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -313,14 +336,14 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -355,9 +378,9 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -376,3 +399,4 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs index f194724add22b..4299f3dfa7f9e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ExpressRouteServiceProvidersOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ExpressRouteServiceProvidersOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class ExpressRouteServiceProvidersOperationsExtensions { /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -35,8 +33,7 @@ public static IPage List(this IExpressRouteServiceP } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -53,8 +50,7 @@ public static IPage List(this IExpressRouteServiceP } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -68,8 +64,7 @@ public static IPage ListNext(this IExpressRouteServ } /// - /// The List ExpressRouteServiceProvider operation retrieves all the available - /// ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The operations group for this extension method. @@ -90,3 +85,4 @@ public static IPage ListNext(this IExpressRouteServ } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs index 8cffebc7f0662..b91024daec0de 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IApplicationGatewaysOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// ApplicationGatewaysOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IApplicationGatewaysOperations { /// - /// The delete ApplicationGateway operation deletes the specified - /// application gateway. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -38,10 +38,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete ApplicationGateway operation deletes the specified - /// application gateway. + /// Gets the specified application gateway. /// /// /// The name of the resource group. @@ -55,10 +60,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get ApplicationGateway operation retrieves information about - /// the specified application gateway. + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. @@ -66,83 +79,114 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put ApplicationGateway operation creates/updates a - /// ApplicationGateway + /// Lists all application gateways in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put ApplicationGateway operation creates/updates a - /// ApplicationGateway + /// Gets all the application gateways in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the ApplicationGateway. - /// - /// - /// Parameters supplied to the create/delete ApplicationGateway - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a resource group. + /// Starts the specified application gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the application gateway. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a subscription. + /// Stops the specified application gateway in a resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the application gateway. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Start ApplicationGateway operation starts application gateway - /// in the specified resource group through Network resource provider. + /// Gets the backend health of the specified application gateway in a + /// resource group. /// /// /// The name of the resource group. @@ -150,16 +194,28 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// + /// + /// Expands BackendAddressPool and BackendHttpSettings referenced in + /// backend health. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task StartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Start ApplicationGateway operation starts application gateway - /// in the specified resource group through Network resource provider. + /// Deletes the specified application gateway. /// /// /// The name of the resource group. @@ -173,10 +229,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The STOP ApplicationGateway operation stops application gateway in - /// the specified resource group through Network resource provider. + /// Creates or updates the specified application gateway. /// /// /// The name of the resource group. @@ -184,16 +245,28 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// + /// + /// Parameters supplied to the create or update application gateway + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task StopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, ApplicationGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The STOP ApplicationGateway operation stops application gateway in - /// the specified resource group through Network resource provider. + /// Starts the specified application gateway. /// /// /// The name of the resource group. @@ -207,11 +280,15 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation token. /// - Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The BackendHealth operation gets the backend health of application - /// gateway in the specified resource group through Network resource - /// provider. + /// Stops the specified application gateway in a resource group. /// /// /// The name of the resource group. @@ -219,21 +296,22 @@ public partial interface IApplicationGatewaysOperations /// /// The name of the application gateway. /// - /// - /// Expands BackendAddressPool and BackendHttpSettings referenced in - /// backend health. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStopWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The BackendHealth operation gets the backend health of application - /// gateway in the specified resource group through Network resource - /// provider. + /// Gets the backend health of the specified application gateway in a + /// resource group. /// /// /// The name of the resource group. @@ -251,10 +329,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation 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> BeginBackendHealthWithHttpMessagesAsync(string resourceGroupName, string applicationGatewayName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a resource group. + /// Lists all application gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -265,10 +351,18 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation 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)); /// - /// The List ApplicationGateway operation retrieves all the - /// application gateways in a subscription. + /// Gets all the application gateways in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -279,6 +373,16 @@ public partial interface IApplicationGatewaysOperations /// /// The cancellation 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)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs index 47791b6c045f9..91d20a267edb4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitAuthorizationsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteCircuitAuthorizationsOperations operations. @@ -23,8 +24,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitAuthorizationsOperations { /// - /// The delete authorization operation deletes the specified - /// authorization from the specified ExpressRouteCircuit. + /// Deletes the specified authorization from the specified express + /// route circuit. /// /// /// The name of the resource group. @@ -41,10 +42,16 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete authorization operation deletes the specified - /// authorization from the specified ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -61,10 +68,19 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The GET authorization operation retrieves the specified - /// authorization from the specified ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -75,29 +91,34 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The name of the authorization. /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put Authorization operation creates/updates an authorization - /// in the specified ExpressRouteCircuits + /// Gets all authorizations in an express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route circuit. - /// - /// - /// The name of the authorization. - /// - /// - /// Parameters supplied to the create/update - /// ExpressRouteCircuitAuthorization operation + /// The name of the circuit. /// /// /// The headers that will be added to request. @@ -105,10 +126,19 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put Authorization operation creates/updates an authorization - /// in the specified ExpressRouteCircuits + /// Deletes the specified authorization from the specified express + /// route circuit. /// /// /// The name of the resource group. @@ -119,26 +149,35 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The name of the authorization. /// - /// - /// Parameters supplied to the create/update - /// ExpressRouteCircuitAuthorization operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List authorization operation retrieves all the authorizations - /// in an ExpressRouteCircuit. + /// Creates or updates an authorization in the specified express route + /// circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the authorization. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// authorization operation. /// /// /// The headers that will be added to request. @@ -146,10 +185,18 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List authorization operation retrieves all the authorizations - /// in an ExpressRouteCircuit. + /// Gets all authorizations in an express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +207,16 @@ public partial interface IExpressRouteCircuitAuthorizationsOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs index 45d56ff832132..bad2aab8cf056 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitPeeringsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteCircuitPeeringsOperations operations. @@ -23,8 +24,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitPeeringsOperations { /// - /// The delete peering operation deletes the specified peering from - /// the ExpressRouteCircuit. + /// Deletes the specified peering from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -41,10 +42,16 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete peering operation deletes the specified peering from - /// the ExpressRouteCircuit. + /// Gets the specified authorization from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -61,10 +68,19 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The GET peering operation retrieves the specified authorization - /// from the ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route + /// circuits. /// /// /// The name of the resource group. @@ -75,16 +91,28 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the peering. /// + /// + /// Parameters supplied to the create or update express route circuit + /// peering operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put Peering operation creates/updates an peering in the - /// specified ExpressRouteCircuits + /// Gets all peerings in a specified express route circuit. /// /// /// The name of the resource group. @@ -92,23 +120,25 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the express route circuit. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit - /// Peering operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put Peering operation creates/updates an peering in the - /// specified ExpressRouteCircuits + /// Deletes the specified peering from the specified express route + /// circuit. /// /// /// The name of the resource group. @@ -119,26 +149,35 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The name of the peering. /// - /// - /// Parameters supplied to the create/update ExpressRouteCircuit - /// Peering operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Creates or updates a peering in the specified express route + /// circuits. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// peering operation. /// /// /// The headers that will be added to request. @@ -146,10 +185,18 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, ExpressRouteCircuitPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List peering operation retrieves all the peerings in an - /// ExpressRouteCircuit. + /// Gets all peerings in a specified express route circuit. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +207,16 @@ public partial interface IExpressRouteCircuitPeeringsOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs index 644ab80a5d3c3..4f776a90e113f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteCircuitsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteCircuitsOperations operations. @@ -23,14 +24,13 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteCircuitsOperations { /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -38,33 +38,21 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete ExpressRouteCircuit operation deletes the specified - /// ExpressRouteCircuit. + /// Gets information about the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the express route Circuit. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Get ExpressRouteCircuit operation retrieves information about - /// the specified ExpressRouteCircuit. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the circuit. + /// The name of express route circuit. /// /// /// The headers that will be added to request. @@ -72,10 +60,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation 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 circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put ExpressRouteCircuit operation creates/updates a - /// ExpressRouteCircuit + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -84,8 +80,8 @@ public partial interface IExpressRouteCircuitsOperations /// The name of the circuit. /// /// - /// Parameters supplied to the create/delete ExpressRouteCircuit - /// operation + /// Parameters supplied to the create or update express route circuit + /// operation. /// /// /// The headers that will be added to request. @@ -93,20 +89,31 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation 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 circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put ExpressRouteCircuit operation creates/updates a - /// ExpressRouteCircuit + /// Gets the currently advertised ARP table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// - /// - /// Parameters supplied to the create/delete ExpressRouteCircuit - /// operation + /// + /// The name of the peering. + /// + /// + /// The path of the device. /// /// /// The headers that will be added to request. @@ -114,17 +121,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -138,17 +153,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The ListArpTable from ExpressRouteCircuit operation retrieves the - /// currently advertised arp table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table summary associated with + /// the express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. @@ -162,23 +185,25 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the stats from an express route circuit in a resource + /// group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -186,71 +211,93 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all stats from an express route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// - /// - /// The path of the device. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the circuit. - /// - /// - /// The name of the peering. + /// + /// The headers that will be added to request. /// - /// - /// The path of the device. + /// + /// The cancellation 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the express route circuits in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The ListRoutesTable from ExpressRouteCircuit operation retrieves - /// the currently advertised routes table associated with the - /// ExpressRouteCircuits in a resource group. + /// Deletes the specified express route circuit. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. - /// - /// - /// The name of the peering. - /// - /// - /// The path of the device. + /// The name of the express route circuit. /// /// /// The headers that will be added to request. @@ -258,10 +305,15 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation token. /// - Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List stats ExpressRouteCircuit operation retrieves all the - /// stats from a ExpressRouteCircuits in a resource group. + /// Creates or updates an express route circuit. /// /// /// The name of the resource group. @@ -269,61 +321,124 @@ public partial interface IExpressRouteCircuitsOperations /// /// The name of the circuit. /// + /// + /// Parameters supplied to the create or update express route circuit + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List stats ExpressRouteCircuit operation retrieves all the - /// stats from a ExpressRouteCircuits in a resource group. + /// Gets the currently advertised ARP table associated with the express + /// route circuit in a resource group. /// /// /// The name of the resource group. /// /// - /// The name of the circuit. + /// The name of the express route circuit. /// /// /// The name of the peering. /// + /// + /// The path of the device. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetPeeringStatsWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets the currently advertised routes table associated with the + /// express route circuit in a resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets the currently advertised routes table summary associated with + /// the express route circuit in a resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a resource group. + /// Gets all the express route circuits in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -334,10 +449,18 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation 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)); /// - /// The List ExpressRouteCircuit operation retrieves all the - /// ExpressRouteCircuits in a subscription. + /// Gets all the express route circuits in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -348,6 +471,16 @@ public partial interface IExpressRouteCircuitsOperations /// /// The cancellation 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)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs index ff765a95b6d9b..991744d758e2e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IExpressRouteServiceProvidersOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// ExpressRouteServiceProvidersOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IExpressRouteServiceProvidersOperations { /// - /// The List ExpressRouteServiceProvider operation retrieves all the - /// available ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The headers that will be added to request. @@ -32,10 +32,18 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// The cancellation 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)); /// - /// The List ExpressRouteServiceProvider operation retrieves all the - /// available ExpressRouteServiceProviders. + /// Gets all the available express route service providers. /// /// /// The NextLink from the previous successful call to List operation. @@ -46,6 +54,16 @@ public partial interface IExpressRouteServiceProvidersOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs index 5afcbdc831b9f..d0761541c3f09 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILoadBalancersOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// LoadBalancersOperations operations. @@ -23,14 +24,13 @@ namespace Microsoft.Azure.Management.Network public partial interface ILoadBalancersOperations { /// - /// The delete LoadBalancer operation deletes the specified load - /// balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The headers that will be added to request. @@ -38,16 +38,24 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete LoadBalancer operation deletes the specified load - /// balancer. + /// Gets the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. + /// + /// + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -55,19 +63,28 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get LoadBalancer operation retrieves information about the - /// specified LoadBalancer. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update load balancer + /// operation. /// /// /// The headers that will be added to request. @@ -75,73 +92,110 @@ public partial interface ILoadBalancersOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a subscription. + /// Deletes the specified load balancer. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a resource group. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a subscription. + /// Gets all the load balancers in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -152,10 +206,18 @@ public partial interface ILoadBalancersOperations /// /// The cancellation 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)); /// - /// The List loadBalancer operation retrieves all the load balancers - /// in a resource group. + /// Gets all the load balancers in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -166,6 +228,16 @@ public partial interface ILoadBalancersOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs index 63013a234ec46..fa331906ea339 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ILocalNetworkGatewaysOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// LocalNetworkGatewaysOperations operations. @@ -23,9 +24,8 @@ namespace Microsoft.Azure.Management.Network public partial interface ILocalNetworkGatewaysOperations { /// - /// The Put LocalNetworkGateway operation creates/updates a local - /// network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a local network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -34,8 +34,8 @@ public partial interface ILocalNetworkGatewaysOperations /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network - /// Gateway operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -43,11 +43,18 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation 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 localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put LocalNetworkGateway operation creates/updates a local - /// network gateway in the specified resource group through Network - /// resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The name of the resource group. @@ -55,21 +62,24 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Local Network - /// Gateway operation through Network resource provider. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get LocalNetworkGateway operation retrieves information about - /// the specified local network gateway through Network resource - /// provider. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -83,27 +93,38 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete LocalNetworkGateway operation deletes the specified - /// local network Gateway through Network resource provider. + /// Gets all the local network gateways in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete LocalNetworkGateway operation deletes the specified - /// local network Gateway through Network resource provider. + /// Creates or updates a local network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -111,30 +132,50 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The name of the local network gateway. /// + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List LocalNetworkGateways operation retrieves all the local - /// network gateways stored. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the local network gateway. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List LocalNetworkGateways operation retrieves all the local - /// network gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -145,6 +186,16 @@ public partial interface ILocalNetworkGatewaysOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs index a12bce9886ca6..c35bc2e24de04 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkInterfacesOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// NetworkInterfacesOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkInterfacesOperations { /// - /// The delete netwokInterface operation deletes the specified - /// netwokInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -38,27 +38,15 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete netwokInterface operation deletes the specified - /// netwokInterface. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The Get network interface operation retrieves information about - /// the specified network interface. + /// Gets information about the specified network interface. /// /// /// The name of the resource group. @@ -67,7 +55,7 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -75,10 +63,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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 networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put NetworkInterface operation creates/updates a - /// networkInterface + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -87,7 +83,8 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface + /// operation. /// /// /// The headers that will be added to request. @@ -95,31 +92,19 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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 networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put NetworkInterface operation creates/updates a - /// networkInterface - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create/update NetworkInterface operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine from a virtual - /// machine scale set. + /// Gets information about all network interfaces in a virtual machine + /// in a virtual machine scale set. /// /// /// The name of the resource group. @@ -136,10 +121,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The name of the resource group. @@ -153,10 +146,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get network interface operation retrieves information about - /// the specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The name of the resource group. @@ -171,7 +172,7 @@ public partial interface INetworkInterfacesOperations /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The headers that will be added to request. @@ -179,10 +180,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The headers that will be added to request. @@ -190,10 +199,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The name of the resource group. @@ -204,10 +221,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The get effective routetable operation retrieves all the route - /// tables applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -221,10 +246,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The get effective routetable operation retrieves all the route - /// tables applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. @@ -238,10 +271,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list effective network security group operation retrieves all - /// the network security groups applied on a networkInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -255,10 +296,15 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation token. /// - Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list effective network security group operation retrieves all - /// the network security groups applied on a networkInterface. + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -266,17 +312,79 @@ public partial interface INetworkInterfacesOperations /// /// The name of the network interface. /// + /// + /// Parameters supplied to the create or update network interface + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// 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> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// 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> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine from a virtual - /// machine scale set. + /// Gets information about all network interfaces in a virtual machine + /// in a virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -287,10 +395,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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>> ListVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list network interface operation retrieves information about - /// all network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -301,10 +417,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -315,10 +439,18 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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)); /// - /// The List networkInterfaces operation retrieves all the - /// networkInterfaces in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -329,6 +461,16 @@ public partial interface INetworkInterfacesOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs index 8b6d6b612123a..8e6aa29e5d86b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkManagementClient.cs @@ -1,22 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// The Microsoft Azure Network management API provides a RESTful set of @@ -25,37 +26,37 @@ namespace Microsoft.Azure.Management.Network /// relationship between an end user and the Microsoft Azure Networks /// service. /// - public partial interface INetworkManagementClient : IDisposable + public partial interface INetworkManagementClient : System.IDisposable { /// /// The base URI of the service. /// - Uri BaseUri { get; set; } + System.Uri BaseUri { get; set; } /// /// 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; } /// - /// Gets Azure subscription credentials. + /// Credentials needed for the client to connect to Azure. /// ServiceClientCredentials Credentials { get; } /// - /// Gets subscription credentials which uniquely identify Microsoft + /// The subscription credentials which uniquely identify the Microsoft /// Azure subscription. The subscription ID forms part of the URI for /// every service call. /// string SubscriptionId { get; set; } /// - /// Client Api Version. + /// Client API version. /// string ApiVersion { get; } @@ -71,8 +72,8 @@ public partial interface INetworkManagementClient : IDisposable int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// 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; } @@ -172,12 +173,12 @@ public partial interface INetworkManagementClient : IDisposable /// IVirtualNetworksOperations VirtualNetworks { get; } - /// + /// /// Checks whether a domain name in the cloudapp.net zone is available /// for use. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following @@ -193,3 +194,4 @@ public partial interface INetworkManagementClient : IDisposable } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs index 74cbec4c0da83..195b7bab63b5f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/INetworkSecurityGroupsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// NetworkSecurityGroupsOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface INetworkSecurityGroupsOperations { /// - /// The Delete NetworkSecurityGroup operation deletes the specified - /// network security group + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -38,10 +38,15 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete NetworkSecurityGroup operation deletes the specified - /// network security group + /// Gets the specified network security group. /// /// /// The name of the resource group. @@ -49,16 +54,28 @@ public partial interface INetworkSecurityGroupsOperations /// /// The name of the network security group. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get NetworkSecurityGroups operation retrieves information - /// about the specified network security group. + /// Creates or updates a network security group in the specified + /// resource group. /// /// /// The name of the resource group. @@ -66,8 +83,9 @@ public partial interface INetworkSecurityGroupsOperations /// /// The name of the network security group. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The headers that will be added to request. @@ -75,77 +93,111 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put NetworkSecurityGroup operation creates/updates a network - /// security group in the specified resource group. + /// Gets all network security groups in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The Put NetworkSecurityGroup operation creates/updates a network - /// security group in the specified resource group. + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a subscription + /// Deletes the specified network security group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a resource group + /// Creates or updates a network security group in the specified + /// resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a subscription + /// Gets all network security groups in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -156,10 +208,18 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation 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)); /// - /// The list NetworkSecurityGroups returns all network security groups - /// in a resource group + /// Gets all network security groups in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -170,6 +230,16 @@ public partial interface INetworkSecurityGroupsOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs index 12ff1c26a2d00..3e523929b7693 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IPublicIpAddressesOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// PublicIPAddressesOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IPublicIPAddressesOperations { /// - /// The delete publicIpAddress operation deletes the specified - /// publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. @@ -38,10 +38,15 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete publicIpAddress operation deletes the specified - /// publicIpAddress. + /// Gets the specified public IP address in a specified resource group. /// /// /// The name of the resource group. @@ -49,25 +54,37 @@ public partial interface IPublicIPAddressesOperations /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the subnet. + /// The name of the public IP address. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update public IP address + /// operation. /// /// /// The headers that will be added to request. @@ -75,75 +92,110 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all the public IP addresses in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a subscription. + /// Deletes the specified public IP address. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -154,10 +206,18 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation 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)); /// - /// The List publicIpAddress operation retrieves all the - /// publicIpAddresses in a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -168,6 +228,16 @@ public partial interface IPublicIPAddressesOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs index cdcf9ccee6060..764a86d571351 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRouteTablesOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// RouteTablesOperations operations. @@ -23,7 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IRouteTablesOperations { /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -37,9 +38,15 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Gets the specified route table. /// /// /// The name of the resource group. @@ -47,16 +54,27 @@ public partial interface IRouteTablesOperations /// /// The name of the route table. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get RouteTables operation retrieves information about the - /// specified route table. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -64,8 +82,8 @@ public partial interface IRouteTablesOperations /// /// The name of the route table. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update route table operation. /// /// /// The headers that will be added to request. @@ -73,30 +91,59 @@ public partial interface IRouteTablesOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Gets all route tables in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the route table. + /// + /// The headers that will be added to request. /// - /// - /// Parameters supplied to the create/update Route Table operation + /// + /// The cancellation 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all route tables in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -104,41 +151,49 @@ public partial interface IRouteTablesOperations /// /// The name of the route table. /// - /// - /// Parameters supplied to the create/update Route Table operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list RouteTables returns all route tables in a resource group + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. /// - /// - /// The headers that will be added to request. + /// + /// The name of the route table. /// - /// - /// The cancellation token. + /// + /// Parameters supplied to the create or update route table operation. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The list RouteTables returns all route tables in a subscription - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -149,9 +204,18 @@ public partial interface IRouteTablesOperations /// /// The cancellation 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)); /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -162,6 +226,16 @@ public partial interface IRouteTablesOperations /// /// The cancellation 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)); } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs index d79019b534b1e..70cf8855041a2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IRoutesOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// RoutesOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IRoutesOperations { /// - /// The delete route operation deletes the specified route from a - /// route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -41,10 +41,15 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete route operation deletes the specified route from a - /// route table. + /// Gets the specified route from a route table. /// /// /// The name of the resource group. @@ -61,10 +66,18 @@ public partial interface IRoutesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get route operation retrieves information about the specified - /// route from the route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -75,16 +88,27 @@ public partial interface IRoutesOperations /// /// The name of the route. /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put route operation creates/updates a route in the specified - /// route table + /// Gets all routes in a route table. /// /// /// The name of the resource group. @@ -92,22 +116,24 @@ public partial interface IRoutesOperations /// /// The name of the route table. /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create/update route operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put route operation creates/updates a route in the specified - /// route table + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -118,19 +144,21 @@ public partial interface IRoutesOperations /// /// The name of the route. /// - /// - /// Parameters supplied to the create/update route operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List network security rule operation retrieves all the routes - /// in a route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -138,16 +166,30 @@ public partial interface IRoutesOperations /// /// The name of the route table. /// + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List network security rule operation retrieves all the routes - /// in a route table. + /// Gets all routes in a route table. /// /// /// The NextLink from the previous successful call to List operation. @@ -158,6 +200,16 @@ public partial interface IRoutesOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs index 431accdfbe8ad..617b6a7171dcb 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISecurityRulesOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// SecurityRulesOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface ISecurityRulesOperations { /// - /// The delete network security rule operation deletes the specified - /// network security rule. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -41,10 +41,15 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete network security rule operation deletes the specified - /// network security rule. + /// Get the specified network security rule. /// /// /// The name of the resource group. @@ -61,10 +66,19 @@ public partial interface ISecurityRulesOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get NetworkSecurityRule operation retrieves information about - /// the specified network security rule. + /// Creates or updates a security rule in the specified network + /// security group. /// /// /// The name of the resource group. @@ -75,16 +89,28 @@ public partial interface ISecurityRulesOperations /// /// The name of the security rule. /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put network security rule operation creates/updates a security - /// rule in the specified network security group + /// Gets all security rules in a network security group. /// /// /// The name of the resource group. @@ -92,23 +118,24 @@ public partial interface ISecurityRulesOperations /// /// The name of the network security group. /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create/update network security rule - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put network security rule operation creates/updates a security - /// rule in the specified network security group + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -119,20 +146,22 @@ public partial interface ISecurityRulesOperations /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create/update network security rule - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List network security rule operation retrieves all the - /// security rules in a network security group. + /// Creates or updates a security rule in the specified network + /// security group. /// /// /// The name of the resource group. @@ -140,16 +169,31 @@ public partial interface ISecurityRulesOperations /// /// The name of the network security group. /// + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List network security rule operation retrieves all the - /// security rules in a network security group. + /// Gets all security rules in a network security group. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +204,16 @@ public partial interface ISecurityRulesOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs index f27260f223116..ff6225b5e2265 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/ISubnetsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// SubnetsOperations operations. @@ -23,7 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface ISubnetsOperations { /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -40,9 +41,15 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete subnet operation deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The name of the resource group. @@ -53,16 +60,27 @@ public partial interface ISubnetsOperations /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get subnet operation retrieves information about the specified - /// subnet. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -73,8 +91,8 @@ public partial interface ISubnetsOperations /// /// The name of the subnet. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update subnet operation. /// /// /// The headers that will be added to request. @@ -82,10 +100,18 @@ public partial interface ISubnetsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put Subnet operation creates/updates a subnet in the specified - /// virtual network + /// Gets all subnets in a virtual network. /// /// /// The name of the resource group. @@ -93,22 +119,24 @@ public partial interface ISubnetsOperations /// /// The name of the virtual network. /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create/update Subnet operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put Subnet operation creates/updates a subnet in the specified - /// virtual network + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -119,19 +147,21 @@ public partial interface ISubnetsOperations /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create/update Subnet operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List subnets operation retrieves all the subnets in a virtual - /// network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -139,16 +169,30 @@ public partial interface ISubnetsOperations /// /// The name of the virtual network. /// + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List subnets operation retrieves all the subnets in a virtual - /// network. + /// Gets all subnets in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -159,6 +203,16 @@ public partial interface ISubnetsOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs index 3895bb0359582..6a6c2b90fac2f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IUsagesOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// UsagesOperations operations. @@ -26,7 +27,7 @@ public partial interface IUsagesOperations /// Lists compute usages for a subscription. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// /// /// The headers that will be added to request. @@ -34,6 +35,15 @@ public partial interface IUsagesOperations /// /// The cancellation 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 location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists compute usages for a subscription. @@ -47,6 +57,16 @@ public partial interface IUsagesOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs index e2e3b8a44d98e..2547fc611c78e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewayConnectionsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworkGatewayConnectionsOperations operations. @@ -23,9 +24,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkGatewayConnectionsOperations { /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates - /// a virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// Creates or updates a virtual network gateway connection in the + /// specified resource group. /// /// /// The name of the resource group. @@ -34,8 +34,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The headers that will be added to request. @@ -43,11 +43,19 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation 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 virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates - /// a virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// Gets the specified virtual network gateway connection by resource + /// group. /// /// /// The name of the resource group. @@ -55,21 +63,24 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway connection operation through Network resource provider. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get VirtualNetworkGatewayConnection operation retrieves - /// information about the specified virtual network gateway - /// connection through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -83,17 +94,28 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the - /// specified virtual network Gateway connection through Network - /// resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// virtual network gateway connection shared key for passed virtual + /// network gateway connection in the specified resource group through + /// Network resource provider. /// /// /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway + /// connection Shared key operation throughNetwork resource provider. /// /// /// The headers that will be added to request. @@ -101,17 +123,26 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the - /// specified virtual network Gateway connection through Network - /// resource provider. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation + /// retrieves information about the specified virtual network gateway + /// connection shared key through Network resource provider. /// /// /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection shared key name. /// /// /// The headers that will be added to request. @@ -119,45 +150,54 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets - /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all + /// the virtual network gateways connections created. /// /// /// The name of the resource group. /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway - /// connection Shared key operation throughNetwork resource provider. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// virtual network gateway connection in the specified resource group + /// through Network resource provider. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway - /// connection Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway + /// connection shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -165,17 +205,29 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation - /// retrieves information about the specified virtual network gateway - /// connection shared key through Network resource provider. + /// Creates or updates a virtual network gateway connection in the + /// specified resource group. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. + /// + /// + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The headers that will be added to request. @@ -183,36 +235,53 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List VirtualNetworkGatewayConnections operation retrieves all - /// the virtual network gateways connections created. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway connection. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets - /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// virtual network gateway connection shared key for passed virtual + /// network gateway connection in the specified resource group through + /// Network resource provider. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection reset shared key Name. + /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway - /// connection shared key operation through Network resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway + /// connection Shared key operation throughNetwork resource provider. /// /// /// The headers that will be added to request. @@ -220,12 +289,21 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation token. /// - Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets /// the virtual network gateway connection shared key for passed - /// virtual network gateway connection in the specified resource - /// group through Network resource provider. + /// virtual network gateway connection in the specified resource group + /// through Network resource provider. /// /// /// The name of the resource group. @@ -234,8 +312,8 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway - /// connection shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway + /// connection shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -243,6 +321,15 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation 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> BeginResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The List VirtualNetworkGatewayConnections operation retrieves all @@ -257,6 +344,16 @@ public partial interface IVirtualNetworkGatewayConnectionsOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs index 217339d13dc15..f529897ad1509 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworkGatewaysOperations operations. @@ -23,9 +24,8 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkGatewaysOperations { /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual - /// network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -34,8 +34,8 @@ public partial interface IVirtualNetworkGatewaysOperations /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -43,11 +43,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation 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 virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual - /// network gateway in the specified resource group through Network - /// resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The name of the resource group. @@ -55,21 +62,24 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network - /// Gateway operation through Network resource provider. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get VirtualNetworkGateway operation retrieves information - /// about the specified virtual network gateway through Network - /// resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -83,27 +93,38 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete VirtualNetworkGateway operation deletes the specified - /// virtual network Gateway through Network resource provider. + /// Gets all virtual network gateways by resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete VirtualNetworkGateway operation deletes the specified - /// virtual network Gateway through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -111,31 +132,59 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// + /// + /// Virtual network gateway vip address supplied to the begin reset of + /// the active-active feature enabled gateway. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List VirtualNetworkGateways operation retrieves all the - /// virtual network gateways stored. + /// Generates VPN client package for P2S client of the virtual network + /// gateway in the specified resource group. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the generate virtual network gateway VPN + /// client package operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Reset VirtualNetworkGateway operation resets the primary of - /// the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -143,9 +192,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// + /// Parameters supplied to create or update virtual network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -153,11 +202,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Reset VirtualNetworkGateway operation resets the primary of - /// the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -165,21 +221,22 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Generatevpnclientpackage operation generates Vpn client - /// package for P2S client of the virtual network gateway in the - /// specified resource group through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified + /// resource group. /// /// /// The name of the resource group. @@ -187,10 +244,9 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Generating Virtual Network - /// Gateway Vpn client package operation through Network resource - /// provider. + /// + /// Virtual network gateway vip address supplied to the begin reset of + /// the active-active feature enabled gateway. /// /// /// The headers that will be added to request. @@ -198,10 +254,18 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation token. /// - Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List VirtualNetworkGateways operation retrieves all the - /// virtual network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -212,6 +276,16 @@ public partial interface IVirtualNetworkGatewaysOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs index f6d7a975a8c9e..181953c954e3f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworkPeeringsOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworkPeeringsOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworkPeeringsOperations { /// - /// The delete virtual network peering operation deletes the specified - /// peering. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -41,10 +41,15 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The delete virtual network peering operation deletes the specified - /// peering. + /// Gets the specified virtual network peering. /// /// /// The name of the resource group. @@ -61,10 +66,18 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get virtual network peering operation retrieves information - /// about the specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -73,7 +86,11 @@ public partial interface IVirtualNetworkPeeringsOperations /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The headers that will be added to request. @@ -81,10 +98,18 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put virtual network peering operation creates/updates a - /// peering in the specified virtual network + /// Gets all virtual network peerings in a virtual network. /// /// /// The name of the resource group. @@ -92,23 +117,24 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The name of the virtual network. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering - /// operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put virtual network peering operation creates/updates a - /// peering in the specified virtual network + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -117,11 +143,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering - /// operation + /// The name of the virtual network peering. /// /// /// The headers that will be added to request. @@ -129,10 +151,15 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List virtual network peerings operation retrieves all the - /// peerings in a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -140,16 +167,31 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The name of the virtual network. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The List virtual network peerings operation retrieves all the - /// peerings in a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +202,16 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs index e6c91b341bc59..acadbcdad6df9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/IVirtualNetworksOperations.cs @@ -1,21 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; using System.Collections.Generic; - using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworksOperations operations. @@ -23,8 +24,7 @@ namespace Microsoft.Azure.Management.Network public partial interface IVirtualNetworksOperations { /// - /// The Delete VirtualNetwork operation deletes the specified virtual - /// network + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -38,10 +38,15 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Delete VirtualNetwork operation deletes the specified virtual - /// network + /// Gets the specified virtual network by resource group. /// /// /// The name of the resource group. @@ -49,16 +54,28 @@ public partial interface IVirtualNetworksOperations /// /// The name of the virtual network. /// + /// + /// Expands referenced resources. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Get VirtualNetwork operation retrieves information about the - /// specified virtual network. + /// Creates or updates a virtual network in the specified resource + /// group. /// /// /// The name of the resource group. @@ -66,8 +83,9 @@ public partial interface IVirtualNetworksOperations /// /// The name of the virtual network. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update virtual network + /// operation /// /// /// The headers that will be added to request. @@ -75,74 +93,110 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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 virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The Put VirtualNetwork operation creates/updates a virtual network - /// in the specified resource group. + /// Gets all virtual networks in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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)); /// - /// The Put VirtualNetwork operation creates/updates a virtual network - /// in the specified resource group. + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a - /// subscription + /// Checks whether a private IP address is available for use. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a resource - /// group + /// Deletes the specified virtual network. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Checks whether a private Ip address is available for use. + /// Creates or updates a virtual network in the specified resource + /// group. /// /// /// The name of the resource group. @@ -150,8 +204,9 @@ public partial interface IVirtualNetworksOperations /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network + /// operation /// /// /// The headers that will be added to request. @@ -159,10 +214,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation token. /// - Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The list VirtualNetwork returns all Virtual Networks in a - /// subscription + /// Gets all virtual networks in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -173,10 +236,18 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation 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)); /// - /// The list VirtualNetwork returns all Virtual Networks in a resource - /// group + /// Gets all virtual networks in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -187,6 +258,16 @@ public partial interface IVirtualNetworksOperations /// /// The cancellation 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/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs index c49e84e7c35bb..4f252fee36b93 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// LoadBalancersOperations operations. @@ -35,13 +33,16 @@ internal partial class LoadBalancersOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal LoadBalancersOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,13 +51,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The headers that will be added to request. @@ -69,17 +70,20 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, loadBalancerName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Gets the specified load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. + /// + /// + /// Expands referenced resources. /// /// /// Headers that will be added to request. @@ -87,10 +91,22 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -100,11 +116,11 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -117,41 +133,46 @@ internal LoadBalancersOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("loadBalancerName", loadBalancerName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -168,10 +189,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -179,7 +200,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -187,10 +208,23 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -209,13 +243,31 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -224,42 +276,64 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The Get LoadBalancer operation retrieves information about the specified - /// LoadBalancer. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update load balancer operation. + /// + /// + /// The headers that will be added to request. /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all the load balancers in a subscription. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (loadBalancerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -270,48 +344,39 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -328,10 +393,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -339,7 +404,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -353,14 +418,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -382,7 +447,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,9 +460,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,73 +480,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, loadBalancerName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (loadBalancerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -493,43 +528,40 @@ internal LoadBalancersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("loadBalancerName", loadBalancerName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{loadBalancerName}", Uri.EscapeDataString(loadBalancerName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -545,17 +577,11 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -563,7 +589,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -571,20 +597,20 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -606,7 +632,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -614,32 +640,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -657,25 +665,47 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Deletes the specified load balancer. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (loadBalancerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -686,39 +716,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("loadBalancerName", loadBalancerName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -735,10 +769,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -746,7 +780,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -754,22 +788,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -789,31 +815,13 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -822,32 +830,57 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Creates or updates a load balancer. /// /// /// The name of the resource group. /// + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (loadBalancerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -859,40 +892,43 @@ internal LoadBalancersOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("loadBalancerName", loadBalancerName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{loadBalancerName}", System.Uri.EscapeDataString(loadBalancerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -908,11 +944,17 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -920,7 +962,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -928,20 +970,20 @@ internal LoadBalancersOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -963,7 +1005,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -971,14 +1013,32 @@ internal LoadBalancersOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -996,8 +1056,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1008,6 +1067,18 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1034,25 +1105,25 @@ internal LoadBalancersOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1069,10 +1140,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1080,7 +1151,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1094,14 +1165,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1136,9 +1207,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1156,8 +1227,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1168,6 +1238,18 @@ internal LoadBalancersOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1194,25 +1276,25 @@ internal LoadBalancersOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1229,10 +1311,10 @@ internal LoadBalancersOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1240,7 +1322,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1254,14 +1336,14 @@ internal LoadBalancersOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1296,9 +1378,9 @@ internal LoadBalancersOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1317,3 +1399,4 @@ internal LoadBalancersOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs index 9b8aa7b419fad..9377b94e21d4f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LoadBalancersOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for LoadBalancersOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class LoadBalancersOperationsExtensions { /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. @@ -32,15 +31,15 @@ public static partial class LoadBalancersOperationsExtensions /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// public static void Delete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) { - Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).DeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).DeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. @@ -49,7 +48,7 @@ public static void Delete(this ILoadBalancersOperations operations, string resou /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// /// /// The cancellation token. @@ -60,7 +59,7 @@ public static void Delete(this ILoadBalancersOperations operations, string resou } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Gets the specified load balancer. /// /// /// The operations group for this extension method. @@ -69,15 +68,18 @@ public static void Delete(this ILoadBalancersOperations operations, string resou /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// - public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) + /// + /// Expands referenced resources. + /// + public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string)) { - Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginDeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).GetAsync(resourceGroupName, loadBalancerName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete LoadBalancer operation deletes the specified load balancer. + /// Gets the specified load balancer. /// /// /// The operations group for this extension method. @@ -86,19 +88,24 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. + /// + /// + /// Expands referenced resources. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get LoadBalancer operation retrieves information about the specified - /// LoadBalancer. + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -107,19 +114,18 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update load balancer operation. /// - public static LoadBalancer Get(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string)) + public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).GetAsync(resourceGroupName, loadBalancerName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get LoadBalancer operation retrieves information about the specified - /// LoadBalancer. + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -128,70 +134,52 @@ public static void BeginDelete(this ILoadBalancersOperations operations, string /// The name of the resource group. /// /// - /// The name of the loadBalancer. + /// The name of the load balancer. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update load balancer operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, loadBalancerName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// - public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) + public static IPage ListAll(this ILoadBalancersOperations operations) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).CreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this ILoadBalancersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -199,19 +187,13 @@ public static LoadBalancer CreateOrUpdate(this ILoadBalancersOperations operatio /// /// The name of the resource group. /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// - public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) + public static IPage List(this ILoadBalancersOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LoadBalancer operation creates/updates a LoadBalancer + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -219,56 +201,56 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope /// /// The name of the resource group. /// - /// - /// The name of the loadBalancer. - /// - /// - /// Parameters supplied to the create/delete LoadBalancer operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this ILoadBalancersOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// + public static void BeginDelete(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginDeleteAsync(resourceGroupName, loadBalancerName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Deletes the specified load balancer. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the load balancer. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this ILoadBalancersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -276,14 +258,19 @@ public static IPage ListAll(this ILoadBalancersOperations operatio /// /// The name of the resource group. /// - public static IPage List(this ILoadBalancersOperations operations, string resourceGroupName) + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer operation. + /// + public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters) { - return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILoadBalancersOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Creates or updates a load balancer. /// /// /// The operations group for this extension method. @@ -291,20 +278,25 @@ public static IPage List(this ILoadBalancersOperations operations, /// /// The name of the resource group. /// + /// + /// The name of the load balancer. + /// + /// + /// Parameters supplied to the create or update load balancer operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ILoadBalancersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ILoadBalancersOperations operations, string resourceGroupName, string loadBalancerName, LoadBalancer parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, loadBalancerName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. @@ -318,8 +310,7 @@ public static IPage ListAllNext(this ILoadBalancersOperations oper } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// subscription. + /// Gets all the load balancers in a subscription. /// /// /// The operations group for this extension method. @@ -339,8 +330,7 @@ public static IPage ListAllNext(this ILoadBalancersOperations oper } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -354,8 +344,7 @@ public static IPage ListNext(this ILoadBalancersOperations operati } /// - /// The List loadBalancer operation retrieves all the load balancers in a - /// resource group. + /// Gets all the load balancers in a resource group. /// /// /// The operations group for this extension method. @@ -376,3 +365,4 @@ public static IPage ListNext(this ILoadBalancersOperations operati } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs index 9c4c125874c8a..4710309e0eb36 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// LocalNetworkGatewaysOperations operations. @@ -35,13 +33,16 @@ internal partial class LocalNetworkGatewaysOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -60,8 +60,8 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The headers that will be added to request. @@ -74,14 +74,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Send Request AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, localNetworkGatewayName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The name of the resource group. @@ -89,20 +88,28 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network 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 + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -112,19 +119,11 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -137,42 +136,41 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -188,17 +186,11 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -206,7 +198,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -214,20 +206,20 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -257,32 +249,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -300,8 +274,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Get LocalNetworkGateway operation retrieves information about the - /// specified local network gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. @@ -310,29 +283,57 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the local network gateway. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all the local network gateways in a resource group. + /// + /// + /// The name of the resource group. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (localNetworkGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -344,42 +345,40 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -396,10 +395,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -407,7 +406,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -421,14 +420,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -450,7 +449,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -463,9 +462,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -483,8 +482,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The name of the resource group. @@ -492,29 +490,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the local network gateway. /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, localNetworkGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the local network gateway. + /// + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// Headers that will be added to request. @@ -522,10 +500,22 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -535,11 +525,19 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); } - if (this.Client.ApiVersion == null) + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -552,41 +550,42 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{localNetworkGatewayName}", Uri.EscapeDataString(localNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -602,11 +601,17 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -614,7 +619,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -622,10 +627,23 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -644,13 +662,49 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -659,32 +713,47 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Deletes the specified local network gateway. /// /// /// The name of the resource group. /// + /// + /// The name of the local network gateway. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string localNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (localNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "localNetworkGatewayName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -696,40 +765,42 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("localNetworkGatewayName", localNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{localNetworkGatewayName}", System.Uri.EscapeDataString(localNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -746,10 +817,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -757,7 +828,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -765,22 +836,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -800,31 +863,13 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -833,8 +878,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -845,6 +889,18 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -871,25 +927,25 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -906,10 +962,10 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -917,7 +973,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -931,14 +987,14 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -973,9 +1029,9 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -994,3 +1050,4 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs index 7e232e853e232..2d9a7a7744d4b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/LocalNetworkGatewaysOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for LocalNetworkGatewaysOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class LocalNetworkGatewaysOperationsExtensions { /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -36,8 +34,8 @@ public static partial class LocalNetworkGatewaysOperationsExtensions /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) { @@ -45,8 +43,7 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -58,8 +55,8 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera /// The name of the local network gateway. /// /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to the create or update local network gateway + /// operation. /// /// /// The cancellation token. @@ -73,8 +70,7 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The operations group for this extension method. @@ -85,18 +81,13 @@ public static LocalNetworkGateway CreateOrUpdate(this ILocalNetworkGatewaysOpera /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. - /// - public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) + public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).GetAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put LocalNetworkGateway operation creates/updates a local network - /// gateway in the specified resource group through Network resource provider. + /// Gets the specified local network gateway in a resource group. /// /// /// The operations group for this extension method. @@ -107,24 +98,19 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways /// /// The name of the local network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Local Network Gateway - /// operation through Network resource provider. - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Get LocalNetworkGateway operation retrieves information about the - /// specified local network gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -135,14 +121,13 @@ public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGateways /// /// The name of the local network gateway. /// - public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).GetAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get LocalNetworkGateway operation retrieves information about the - /// specified local network gateway through Network resource provider. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -156,17 +141,13 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera /// /// The cancellation token. /// - public static async Task GetAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -174,17 +155,13 @@ public static LocalNetworkGateway Get(this ILocalNetworkGatewaysOperations opera /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// - public static void Delete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + public static IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) { - Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -192,20 +169,19 @@ public static void Delete(this ILocalNetworkGatewaysOperations operations, strin /// /// The name of the resource group. /// - /// - /// The name of the local network gateway. - /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -216,14 +192,17 @@ public static void Delete(this ILocalNetworkGatewaysOperations operations, strin /// /// The name of the local network gateway. /// - public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// + public static LocalNetworkGateway BeginCreateOrUpdate(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters) { - Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete LocalNetworkGateway operation deletes the specified local - /// network Gateway through Network resource provider. + /// Creates or updates a local network gateway in the specified resource group. /// /// /// The operations group for this extension method. @@ -234,17 +213,23 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, /// /// The name of the local network gateway. /// + /// + /// Parameters supplied to the create or update local network gateway + /// operation. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, LocalNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -252,14 +237,16 @@ public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, /// /// The name of the resource group. /// - public static IPage List(this ILocalNetworkGatewaysOperations operations, string resourceGroupName) + /// + /// The name of the local network gateway. + /// + public static void BeginDelete(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName) { - return Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ILocalNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, localNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Deletes the specified local network gateway. /// /// /// The operations group for this extension method. @@ -267,20 +254,19 @@ public static IPage List(this ILocalNetworkGatewaysOperatio /// /// The name of the resource group. /// + /// + /// The name of the local network gateway. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this ILocalNetworkGatewaysOperations operations, string resourceGroupName, string localNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, localNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -294,8 +280,7 @@ public static IPage ListNext(this ILocalNetworkGatewaysOper } /// - /// The List LocalNetworkGateways operation retrieves all the local network - /// gateways stored. + /// Gets all the local network gateways in a resource group. /// /// /// The operations group for this extension method. @@ -316,3 +301,4 @@ public static IPage ListNext(this ILocalNetworkGatewaysOper } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs index 606d9f1380bd3..5916d2d769c2d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AddressSpace.cs @@ -1,24 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// AddressSpace contains an array of IP address ranges that can be used - /// by subnets + /// AddressSpace contains an array of IP address ranges that can be used by + /// subnets of the virtual network. /// public partial class AddressSpace { @@ -30,17 +30,20 @@ public AddressSpace() { } /// /// Initializes a new instance of the AddressSpace class. /// + /// A list of address blocks reserved for + /// this virtual network in CIDR notation. public AddressSpace(IList addressPrefixes = default(IList)) { AddressPrefixes = addressPrefixes; } /// - /// Gets or sets list of address blocks reserved for this virtual - /// network in CIDR notation + /// Gets or sets a list of address blocks reserved for this virtual + /// network in CIDR notation. /// [JsonProperty(PropertyName = "addressPrefixes")] public IList AddressPrefixes { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs index 9b335b2a368d8..78410098a118a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGateway.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// ApplicationGateways resource + /// Application gateway resource /// [JsonTransformation] public partial class ApplicationGateway : Resource @@ -30,6 +32,49 @@ public ApplicationGateway() { } /// /// Initializes a new instance of the ApplicationGateway class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// SKU of the application gateway resource. + /// SSL policy of the application gateway + /// resource. + /// Operational state of the application + /// gateway resource. Possible values are: 'Stopped', 'Started', + /// 'Running', and 'Stopping'. Possible values include: 'Stopped', + /// 'Starting', 'Running', 'Stopping' + /// Subnets of application the + /// gateway resource. + /// Authentication + /// certificates of the application gateway resource. + /// SSL certificates of the application + /// gateway resource. + /// Frontend IP addresses of the + /// application gateway resource. + /// Frontend ports of the application + /// gateway resource. + /// Probes of the application gateway + /// resource. + /// Backend address pool of the + /// application gateway resource. + /// Backend http settings + /// of the application gateway resource. + /// Http listeners of the application + /// gateway resource. + /// URL path map of the application gateway + /// resource. + /// Request routing rules of the + /// application gateway resource. + /// Web application + /// firewall configuration. + /// Resource GUID property of the + /// application gateway resource. + /// Provisioning state of the + /// application gateway resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGateway(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ApplicationGatewaySku sku = default(ApplicationGatewaySku), ApplicationGatewaySslPolicy sslPolicy = default(ApplicationGatewaySslPolicy), string operationalState = default(string), IList gatewayIPConfigurations = default(IList), IList authenticationCertificates = default(IList), IList sslCertificates = default(IList), IList frontendIPConfigurations = default(IList), IList frontendPorts = default(IList), IList probes = default(IList), IList backendAddressPools = default(IList), IList backendHttpSettingsCollection = default(IList), IList httpListeners = default(IList), IList urlPathMaps = default(IList), IList requestRoutingRules = default(IList), ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration = default(ApplicationGatewayWebApplicationFirewallConfiguration), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -54,125 +99,138 @@ public ApplicationGateway() { } } /// - /// Sku of application gateway resource + /// Gets or sets SKU of the application gateway resource. /// [JsonProperty(PropertyName = "properties.sku")] public ApplicationGatewaySku Sku { get; set; } /// - /// SSL policy of application gateway resource + /// Gets or sets SSL policy of the application gateway resource. /// [JsonProperty(PropertyName = "properties.sslPolicy")] public ApplicationGatewaySslPolicy SslPolicy { get; set; } /// - /// Operational state of application gateway resource. Possible values - /// include: 'Stopped', 'Starting', 'Running', 'Stopping' + /// Gets operational state of the application gateway resource. + /// Possible values are: 'Stopped', 'Started', 'Running', and + /// 'Stopping'. Possible values include: 'Stopped', 'Starting', + /// 'Running', 'Stopping' /// [JsonProperty(PropertyName = "properties.operationalState")] - public string OperationalState { get; private set; } + public string OperationalState { get; protected set; } /// - /// Subnets of application gateway resource + /// Gets or sets subnets of application the gateway resource. /// [JsonProperty(PropertyName = "properties.gatewayIPConfigurations")] public IList GatewayIPConfigurations { get; set; } /// - /// Authentication certificates of application gateway resource + /// Gets or sets authentication certificates of the application gateway + /// resource. /// [JsonProperty(PropertyName = "properties.authenticationCertificates")] public IList AuthenticationCertificates { get; set; } /// - /// SSL certificates of application gateway resource + /// Gets or sets SSL certificates of the application gateway resource. /// [JsonProperty(PropertyName = "properties.sslCertificates")] public IList SslCertificates { get; set; } /// - /// Frontend IP addresses of application gateway resource + /// Gets or sets frontend IP addresses of the application gateway + /// resource. /// [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] public IList FrontendIPConfigurations { get; set; } /// - /// Frontend ports of application gateway resource + /// Gets or sets frontend ports of the application gateway resource. /// [JsonProperty(PropertyName = "properties.frontendPorts")] public IList FrontendPorts { get; set; } /// - /// Probes of application gateway resource + /// Gets or sets probes of the application gateway resource. /// [JsonProperty(PropertyName = "properties.probes")] public IList Probes { get; set; } /// - /// Backend address pool of application gateway resource + /// Gets or sets backend address pool of the application gateway + /// resource. /// [JsonProperty(PropertyName = "properties.backendAddressPools")] public IList BackendAddressPools { get; set; } /// - /// Backend http settings of application gateway resource + /// Gets or sets backend http settings of the application gateway + /// resource. /// [JsonProperty(PropertyName = "properties.backendHttpSettingsCollection")] public IList BackendHttpSettingsCollection { get; set; } /// - /// HTTP listeners of application gateway resource + /// Gets or sets http listeners of the application gateway resource. /// [JsonProperty(PropertyName = "properties.httpListeners")] public IList HttpListeners { get; set; } /// - /// URL path map of application gateway resource + /// Gets or sets URL path map of the application gateway resource. /// [JsonProperty(PropertyName = "properties.urlPathMaps")] public IList UrlPathMaps { get; set; } /// - /// Request routing rules of application gateway resource + /// Gets or sets request routing rules of the application gateway + /// resource. /// [JsonProperty(PropertyName = "properties.requestRoutingRules")] public IList RequestRoutingRules { get; set; } /// - /// Web application firewall configuration + /// Gets or sets web application firewall configuration. /// [JsonProperty(PropertyName = "properties.webApplicationFirewallConfiguration")] public ApplicationGatewayWebApplicationFirewallConfiguration WebApplicationFirewallConfiguration { get; set; } /// - /// Resource guid property of the ApplicationGateway resource + /// Gets or sets resource GUID property of the application gateway + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Provisioning state of the ApplicationGateway resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the application gateway + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { - if (this.WebApplicationFirewallConfiguration != null) + if (WebApplicationFirewallConfiguration != null) { - this.WebApplicationFirewallConfiguration.Validate(); + WebApplicationFirewallConfiguration.Validate(); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs index ad041f416ed6e..8680f153810be 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayAuthenticationCertificate.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Authentication certificates of application gateway + /// Authentication certificates of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayAuthenticationCertificate : SubResource @@ -32,6 +32,16 @@ public ApplicationGatewayAuthenticationCertificate() { } /// Initializes a new instance of the /// ApplicationGatewayAuthenticationCertificate class. /// + /// Resource ID. + /// Certificate public data. + /// Provisioning state of the + /// authentication certificate resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayAuthenticationCertificate(string id = default(string), string data = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,31 +52,33 @@ public ApplicationGatewayAuthenticationCertificate() { } } /// - /// Certificate public data + /// Gets or sets certificate public data. /// [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } /// - /// Provisioning state of the authentication certificate resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the authentication certificate + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs index 8862d7930f223..0dc86f884b065 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddress.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Backend Address of application gateway + /// Backend address of an application gateway. /// public partial class ApplicationGatewayBackendAddress { @@ -31,6 +29,8 @@ public ApplicationGatewayBackendAddress() { } /// Initializes a new instance of the ApplicationGatewayBackendAddress /// class. /// + /// Fully qualified domain name (FQDN). + /// IP address public ApplicationGatewayBackendAddress(string fqdn = default(string), string ipAddress = default(string)) { Fqdn = fqdn; @@ -38,16 +38,17 @@ public ApplicationGatewayBackendAddress() { } } /// - /// Dns name + /// Gets or sets fully qualified domain name (FQDN). /// [JsonProperty(PropertyName = "fqdn")] public string Fqdn { get; set; } /// - /// Ip address + /// Gets or sets IP address /// [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs index 8162dd7f4cca1..46787d094f8f2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendAddressPool.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Backend Address Pool of application gateway + /// Backend Address Pool of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayBackendAddressPool : SubResource @@ -32,6 +34,17 @@ public ApplicationGatewayBackendAddressPool() { } /// Initializes a new instance of the /// ApplicationGatewayBackendAddressPool class. /// + /// Resource ID. + /// Collection of references to + /// IPs defined in network interfaces. + /// Backend addresses + /// Provisioning state of the backend + /// address pool resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Resource that is unique within a resource group. + /// This name can be used to access the resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayBackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList backendAddresses = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -43,37 +56,40 @@ public ApplicationGatewayBackendAddressPool() { } } /// - /// Collection of references to IPs defined in NICs + /// Gets or sets collection of references to IPs defined in network + /// interfaces. /// [JsonProperty(PropertyName = "properties.backendIPConfigurations")] public IList BackendIPConfigurations { get; set; } /// - /// Backend addresses + /// Gets or sets backend addresses /// [JsonProperty(PropertyName = "properties.backendAddresses")] public IList BackendAddresses { get; set; } /// - /// Provisioning state of the backend address pool resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend address pool + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Resource that is unique within a resource group. This name can be - /// used to access the resource + /// Gets or sets resource that is unique within a resource group. This + /// name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs index 3527f5dcd51c3..7bb1cbfbb3a4d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealth.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// List of backendhealth pools. + /// List of ApplicationGatewayBackendHealthPool resources. /// public partial class ApplicationGatewayBackendHealth { @@ -43,3 +43,4 @@ public ApplicationGatewayBackendHealth() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index b799a7fa02b63..4eddf6d181a64 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Application gateway backendhealth http settings. + /// Application gateway BackendHealthHttp settings. /// public partial class ApplicationGatewayBackendHealthHttpSettings { @@ -31,6 +31,10 @@ public ApplicationGatewayBackendHealthHttpSettings() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHealthHttpSettings class. /// + /// Reference of an + /// ApplicationGatewayBackendHttpSettings resource. + /// List of ApplicationGatewayBackendHealthServer + /// resources. public ApplicationGatewayBackendHealthHttpSettings(ApplicationGatewayBackendHttpSettings backendHttpSettings = default(ApplicationGatewayBackendHttpSettings), IList servers = default(IList)) { BackendHttpSettings = backendHttpSettings; @@ -38,16 +42,19 @@ public ApplicationGatewayBackendHealthHttpSettings() { } } /// - /// Reference of application gateway backend http settings resource. + /// Gets or sets reference of an ApplicationGatewayBackendHttpSettings + /// resource. /// [JsonProperty(PropertyName = "backendHttpSettings")] public ApplicationGatewayBackendHttpSettings BackendHttpSettings { get; set; } /// - /// List of application gateway backendhealth servers. + /// Gets or sets list of ApplicationGatewayBackendHealthServer + /// resources. /// [JsonProperty(PropertyName = "servers")] public IList Servers { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs index e7c1cbb85f88b..b8975606d3e68 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthPool.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Application gateway backendhealth pool. + /// Application gateway BackendHealth pool. /// public partial class ApplicationGatewayBackendHealthPool { @@ -31,6 +31,10 @@ public ApplicationGatewayBackendHealthPool() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHealthPool class. /// + /// Reference of an + /// ApplicationGatewayBackendAddressPool resource. + /// List of + /// ApplicationGatewayBackendHealthHttpSettings resources. public ApplicationGatewayBackendHealthPool(ApplicationGatewayBackendAddressPool backendAddressPool = default(ApplicationGatewayBackendAddressPool), IList backendHttpSettingsCollection = default(IList)) { BackendAddressPool = backendAddressPool; @@ -38,16 +42,19 @@ public ApplicationGatewayBackendHealthPool() { } } /// - /// Reference of application gateway backend address pool resource. + /// Gets or sets reference of an ApplicationGatewayBackendAddressPool + /// resource. /// [JsonProperty(PropertyName = "backendAddressPool")] public ApplicationGatewayBackendAddressPool BackendAddressPool { get; set; } /// - /// List of application gateway backendhealth http settings. + /// Gets or sets list of ApplicationGatewayBackendHealthHttpSettings + /// resources. /// [JsonProperty(PropertyName = "backendHttpSettingsCollection")] public IList BackendHttpSettingsCollection { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 1fd307af0e876..6005cd2f240d9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// Application gateway backendhealth http settings. @@ -31,6 +29,12 @@ public ApplicationGatewayBackendHealthServer() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHealthServer class. /// + /// IP address or FQDN of backend server. + /// Reference of IP configuration of + /// backend server. + /// Health of backend server. Possible values are: + /// 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: + /// 'Unknown', 'Up', 'Down', 'Partial' public ApplicationGatewayBackendHealthServer(string address = default(string), SubResource ipConfiguration = default(SubResource), string health = default(string)) { Address = address; @@ -39,23 +43,25 @@ public ApplicationGatewayBackendHealthServer() { } } /// - /// IP address or FQDN of backend server + /// Gets or sets IP address or FQDN of backend server. /// [JsonProperty(PropertyName = "address")] public string Address { get; set; } /// - /// Reference of IP configuration of backend server. + /// Gets or sets reference of IP configuration of backend server. /// [JsonProperty(PropertyName = "ipConfiguration")] public SubResource IpConfiguration { get; set; } /// - /// Health of backend server. Possible values include: 'Unknown', - /// 'Healthy', 'Unhealthy', 'Partial' + /// Gets or sets health of backend server. Possible values are: + /// 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: + /// 'Unknown', 'Up', 'Down', 'Partial' /// [JsonProperty(PropertyName = "health")] public string Health { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs index c63948d3c3f29..db0321dc0ffe7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHealthServerHealth.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayBackendHealthServerHealth. @@ -18,8 +18,9 @@ namespace Microsoft.Azure.Management.Network.Models public static class ApplicationGatewayBackendHealthServerHealth { public const string Unknown = "Unknown"; - public const string Healthy = "Healthy"; - public const string Unhealthy = "Unhealthy"; + public const string Up = "Up"; + public const string Down = "Down"; public const string Partial = "Partial"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs index 63584a836aa98..8b2a1c9329a1a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayBackendHttpSettings.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Backend address pool settings of application gateway + /// Backend address pool settings of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayBackendHttpSettings : SubResource @@ -32,6 +34,29 @@ public ApplicationGatewayBackendHttpSettings() { } /// Initializes a new instance of the /// ApplicationGatewayBackendHttpSettings class. /// + /// Resource ID. + /// Port + /// Protocol. Possible values are: 'Http' and + /// 'Https'. Possible values include: 'Http', 'Https' + /// Cookie based affinity. Possible + /// values are: 'Enabled' and 'Disabled'. Possible values include: + /// 'Enabled', 'Disabled' + /// Request timeout in seconds. + /// Application Gateway will fail the request if response is not + /// received within RequestTimeout. Acceptable values are from 1 second + /// to 86400 seconds. + /// Probe resource of an application + /// gateway. + /// Array of references to + /// application gateway authentication certificates. + /// Provisioning state of the backend + /// http settings resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayBackendHttpSettings(string id = default(string), int? port = default(int?), string protocol = default(string), string cookieBasedAffinity = default(string), int? requestTimeout = default(int?), SubResource probe = default(SubResource), IList authenticationCertificates = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -47,62 +72,68 @@ public ApplicationGatewayBackendHttpSettings() { } } /// - /// Port + /// Gets or sets port /// [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } /// - /// Protocol. Possible values include: 'Http', 'Https' + /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. + /// Possible values include: 'Http', 'Https' /// [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Cookie affinity. Possible values include: 'Enabled', 'Disabled' + /// Gets or sets cookie based affinity. Possible values are: 'Enabled' + /// and 'Disabled'. Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.cookieBasedAffinity")] public string CookieBasedAffinity { get; set; } /// - /// Request timeout + /// Gets or sets request timeout in seconds. Application Gateway will + /// fail the request if response is not received within RequestTimeout. + /// Acceptable values are from 1 second to 86400 seconds. /// [JsonProperty(PropertyName = "properties.requestTimeout")] public int? RequestTimeout { get; set; } /// - /// Probe resource of application gateway + /// Gets or sets probe resource of an application gateway. /// [JsonProperty(PropertyName = "properties.probe")] public SubResource Probe { get; set; } /// - /// Array of references to Application Gateway Authentication - /// Certificates + /// Gets or sets array of references to application gateway + /// authentication certificates. /// [JsonProperty(PropertyName = "properties.authenticationCertificates")] public IList AuthenticationCertificates { get; set; } /// - /// Provisioning state of the backend http settings resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend http settings + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs index bb5019fb19f80..0c18e75ea452e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayCookieBasedAffinity.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayCookieBasedAffinity. @@ -21,3 +21,4 @@ public static class ApplicationGatewayCookieBasedAffinity public const string Disabled = "Disabled"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs index d971faa75cf58..d90d48a8540af 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFirewallMode.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayFirewallMode. @@ -21,3 +21,4 @@ public static class ApplicationGatewayFirewallMode public const string Prevention = "Prevention"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs index a2895e6d93804..15365ef7e9e7e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Frontend IP configuration of application gateway + /// Frontend IP configuration of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayFrontendIPConfiguration : SubResource @@ -32,6 +32,23 @@ public ApplicationGatewayFrontendIPConfiguration() { } /// Initializes a new instance of the /// ApplicationGatewayFrontendIPConfiguration class. /// + /// Resource ID. + /// PrivateIPAddress of the network + /// interface IP Configuration. + /// PrivateIP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// Reference of the subnet resource. + /// Reference of the PublicIP + /// resource. + /// Provisioning state of the public IP + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayFrontendIPConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), SubResource subnet = default(SubResource), SubResource publicIPAddress = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -45,50 +62,53 @@ public ApplicationGatewayFrontendIPConfiguration() { } } /// - /// PrivateIPAddress of the Network Interface IP Configuration + /// Gets or sets privateIPAddress of the network interface IP + /// Configuration. /// [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// PrivateIP allocation method (Static/Dynamic). Possible values - /// include: 'Static', 'Dynamic' + /// Gets or sets privateIP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Reference of the subnet resource + /// Gets or sets reference of the subnet resource. /// [JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// - /// Reference of the PublicIP resource + /// Gets or sets reference of the PublicIP resource. /// [JsonProperty(PropertyName = "properties.publicIPAddress")] public SubResource PublicIPAddress { get; set; } /// - /// Provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs index 2aa96c971f1e8..ea18406784618 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayFrontendPort.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Frontend Port of application gateway + /// Frontend port of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayFrontendPort : SubResource @@ -32,6 +32,16 @@ public ApplicationGatewayFrontendPort() { } /// Initializes a new instance of the ApplicationGatewayFrontendPort /// class. /// + /// Resource ID. + /// Frontend port + /// Provisioning state of the frontend + /// port resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayFrontendPort(string id = default(string), int? port = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,31 +52,32 @@ public ApplicationGatewayFrontendPort() { } } /// - /// Frontend port + /// Gets or sets frontend port /// [JsonProperty(PropertyName = "properties.port")] public int? Port { get; set; } /// - /// Provisioning state of the frontend port resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the frontend port resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs index ade40fdc474d4..330341e081938 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayHttpListener.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Http listener of application gateway + /// Http listener of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayHttpListener : SubResource @@ -32,6 +32,26 @@ public ApplicationGatewayHttpListener() { } /// Initializes a new instance of the ApplicationGatewayHttpListener /// class. /// + /// Resource ID. + /// Frontend IP configuration + /// resource of an application gateway. + /// Frontend port resource of an application + /// gateway. + /// Protocol. Possible values are: 'Http' and + /// 'Https'. Possible values include: 'Http', 'Https' + /// Host name of HTTP listener. + /// SSL certificate resource of an + /// application gateway. + /// Applicable only if + /// protocol is https. Enables SNI for multi-hosting. + /// Provisioning state of the HTTP + /// listener resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayHttpListener(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource frontendPort = default(SubResource), string protocol = default(string), string hostName = default(string), SubResource sslCertificate = default(SubResource), bool? requireServerNameIndication = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -47,61 +67,65 @@ public ApplicationGatewayHttpListener() { } } /// - /// Frontend IP configuration resource of application gateway + /// Gets or sets frontend IP configuration resource of an application + /// gateway. /// [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// - /// Frontend port resource of application gateway + /// Gets or sets frontend port resource of an application gateway. /// [JsonProperty(PropertyName = "properties.frontendPort")] public SubResource FrontendPort { get; set; } /// - /// Protocol. Possible values include: 'Http', 'Https' + /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. + /// Possible values include: 'Http', 'Https' /// [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Host name of http listener + /// Gets or sets host name of HTTP listener. /// [JsonProperty(PropertyName = "properties.hostName")] public string HostName { get; set; } /// - /// Ssl certificate resource of application gateway + /// Gets or sets SSL certificate resource of an application gateway. /// [JsonProperty(PropertyName = "properties.sslCertificate")] public SubResource SslCertificate { get; set; } /// - /// RequireServerNameIndication of http listener + /// Gets or sets applicable only if protocol is https. Enables SNI for + /// multi-hosting. /// [JsonProperty(PropertyName = "properties.requireServerNameIndication")] public bool? RequireServerNameIndication { get; set; } /// - /// Provisioning state of the http listener resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the HTTP listener resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs index 4fd2cbc9f15dc..638422131f6d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayIpConfiguration.cs @@ -1,37 +1,49 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// IP configuration of application gateway + /// IP configuration of an application gateway. Currently 1 public and 1 + /// private IP configuration is allowed. /// [JsonTransformation] public partial class ApplicationGatewayIPConfiguration : SubResource { /// - /// Initializes a new instance of the - /// ApplicationGatewayIPConfiguration class. + /// Initializes a new instance of the ApplicationGatewayIPConfiguration + /// class. /// public ApplicationGatewayIPConfiguration() { } /// - /// Initializes a new instance of the - /// ApplicationGatewayIPConfiguration class. + /// Initializes a new instance of the ApplicationGatewayIPConfiguration + /// class. /// + /// Resource ID. + /// Reference of the subnet resource. A subnet + /// from where application gateway gets its private address. + /// Provisioning state of the + /// application gateway subnet resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayIPConfiguration(string id = default(string), SubResource subnet = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,32 +54,34 @@ public ApplicationGatewayIPConfiguration() { } } /// - /// Reference of the subnet resource. A subnet from where application - /// gateway gets its private address + /// Gets or sets reference of the subnet resource. A subnet from where + /// application gateway gets its private address. /// [JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// - /// Provisioning state of the application gateway subnet resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the application gateway subnet + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs index 5ff7840130715..82005d4c9f3e7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayOperationalState.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayOperationalState. @@ -23,3 +23,4 @@ public static class ApplicationGatewayOperationalState public const string Stopping = "Stopping"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs index 7d1933593224f..22c4e3861fbe2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayPathRule.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Path rule of URL path map of application gateway + /// Path rule of URL path map of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayPathRule : SubResource @@ -30,6 +32,19 @@ public ApplicationGatewayPathRule() { } /// /// Initializes a new instance of the ApplicationGatewayPathRule class. /// + /// Resource ID. + /// Path rules of URL path map. + /// Backend address pool resource of + /// URL path map. + /// Backend http settings resource of + /// URL path map. + /// Path rule of URL path map resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayPathRule(string id = default(string), IList paths = default(IList), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,42 +57,44 @@ public ApplicationGatewayPathRule() { } } /// - /// Path rules of URL path map + /// Gets or sets path rules of URL path map. /// [JsonProperty(PropertyName = "properties.paths")] public IList Paths { get; set; } /// - /// Backend address pool resource of URL path map + /// Gets or sets backend address pool resource of URL path map. /// [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// - /// Backend http settings resource of URL path map + /// Gets or sets backend http settings resource of URL path map. /// [JsonProperty(PropertyName = "properties.backendHttpSettings")] public SubResource BackendHttpSettings { get; set; } /// - /// Path rule of URL path map resource Updating/Deleting/Failed + /// Gets or sets path rule of URL path map resource. Possible values + /// are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs index b750d7e3669eb..6f8786ca36f67 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProbe.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Probe of application gateway + /// Probe of the application gateway. /// [JsonTransformation] public partial class ApplicationGatewayProbe : SubResource @@ -30,6 +30,31 @@ public ApplicationGatewayProbe() { } /// /// Initializes a new instance of the ApplicationGatewayProbe class. /// + /// Resource ID. + /// Protocol. Possible values are: 'Http' and + /// 'Https'. Possible values include: 'Http', 'Https' + /// Host name to send the probe to. + /// Relative path of probe. Valid path starts from + /// '/'. Probe is sent to + /// <Protocol>://<host>:<port><path> + /// The probing interval in seconds. This is the + /// time interval between two consecutive probes. Acceptable values are + /// from 1 second to 86400 seconds. + /// the probe timeout in seconds. Probe marked as + /// failed if valid response is not received with this timeout period. + /// Acceptable values are from 1 second to 86400 seconds. + /// The probe retry count. Backend + /// server is marked down after consecutive probe failure count reaches + /// UnhealthyThreshold. Acceptable values are from 1 second to + /// 20. + /// Provisioning state of the backend + /// http settings resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayProbe(string id = default(string), string protocol = default(string), string host = default(string), string path = default(string), int? interval = default(int?), int? timeout = default(int?), int? unhealthyThreshold = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -45,61 +70,72 @@ public ApplicationGatewayProbe() { } } /// - /// Protocol. Possible values include: 'Http', 'Https' + /// Gets or sets protocol. Possible values are: 'Http' and 'Https'. + /// Possible values include: 'Http', 'Https' /// [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Host to send probe to + /// Gets or sets host name to send the probe to. /// [JsonProperty(PropertyName = "properties.host")] public string Host { get; set; } /// - /// Relative path of probe + /// Gets or sets relative path of probe. Valid path starts from '/'. + /// Probe is sent to + /// &lt;Protocol&gt;://&lt;host&gt;:&lt;port&gt;&lt;path&gt; /// [JsonProperty(PropertyName = "properties.path")] public string Path { get; set; } /// - /// Probing interval in seconds + /// Gets or sets the probing interval in seconds. This is the time + /// interval between two consecutive probes. Acceptable values are from + /// 1 second to 86400 seconds. /// [JsonProperty(PropertyName = "properties.interval")] public int? Interval { get; set; } /// - /// Probing timeout in seconds + /// Gets or sets the probe timeout in seconds. Probe marked as failed + /// if valid response is not received with this timeout period. + /// Acceptable values are from 1 second to 86400 seconds. /// [JsonProperty(PropertyName = "properties.timeout")] public int? Timeout { get; set; } /// - /// Probing unhealthy threshold + /// Gets or sets the probe retry count. Backend server is marked down + /// after consecutive probe failure count reaches UnhealthyThreshold. + /// Acceptable values are from 1 second to 20. /// [JsonProperty(PropertyName = "properties.unhealthyThreshold")] public int? UnhealthyThreshold { get; set; } /// - /// Provisioning state of the backend http settings resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend http settings + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs index 84615f1660ece..e74238d4d0215 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayProtocol.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayProtocol. @@ -21,3 +21,4 @@ public static class ApplicationGatewayProtocol public const string Https = "Https"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs index c8d3a9f86e06c..542b6a384fbf1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRule.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Request routing rule of application gateway + /// Request routing rule of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewayRequestRoutingRule : SubResource @@ -32,6 +32,26 @@ public ApplicationGatewayRequestRoutingRule() { } /// Initializes a new instance of the /// ApplicationGatewayRequestRoutingRule class. /// + /// Resource ID. + /// Rule type. Possible values are: 'Basic' and + /// 'PathBasedRouting'. Possible values include: 'Basic', + /// 'PathBasedRouting' + /// Backend address pool resource of + /// the application gateway. + /// Frontend port resource of the + /// application gateway. + /// Http listener resource of the + /// application gateway. + /// URL path map resource of the application + /// gateway. + /// Provisioning state of the request + /// routing rule resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayRequestRoutingRule(string id = default(string), string ruleType = default(string), SubResource backendAddressPool = default(SubResource), SubResource backendHttpSettings = default(SubResource), SubResource httpListener = default(SubResource), SubResource urlPathMap = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -46,55 +66,60 @@ public ApplicationGatewayRequestRoutingRule() { } } /// - /// Rule type. Possible values include: 'Basic', 'PathBasedRouting' + /// Gets or sets rule type. Possible values are: 'Basic' and + /// 'PathBasedRouting'. Possible values include: 'Basic', + /// 'PathBasedRouting' /// [JsonProperty(PropertyName = "properties.ruleType")] public string RuleType { get; set; } /// - /// Backend address pool resource of application gateway + /// Gets or sets backend address pool resource of the application + /// gateway. /// [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// - /// Frontend port resource of application gateway + /// Gets or sets frontend port resource of the application gateway. /// [JsonProperty(PropertyName = "properties.backendHttpSettings")] public SubResource BackendHttpSettings { get; set; } /// - /// Http listener resource of application gateway + /// Gets or sets http listener resource of the application gateway. /// [JsonProperty(PropertyName = "properties.httpListener")] public SubResource HttpListener { get; set; } /// - /// Url path map resource of application gateway + /// Gets or sets URL path map resource of the application gateway. /// [JsonProperty(PropertyName = "properties.urlPathMap")] public SubResource UrlPathMap { get; set; } /// - /// Provisioning state of the request routing rule resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the request routing rule + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs index 2b80cedf99844..14358e982a4df 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayRequestRoutingRuleType.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayRequestRoutingRuleType. @@ -21,3 +21,4 @@ public static class ApplicationGatewayRequestRoutingRuleType public const string PathBasedRouting = "PathBasedRouting"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs index e38214f7b7393..117e1bf1e4d08 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySku.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// SKU of application gateway + /// SKU of an application gateway /// public partial class ApplicationGatewaySku { @@ -29,6 +27,16 @@ public ApplicationGatewaySku() { } /// /// Initializes a new instance of the ApplicationGatewaySku class. /// + /// Name of an application gateway SKU. Possible + /// values are: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// 'WAF_Medium', and 'WAF_Large'. Possible values include: + /// 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// 'WAF_Medium', 'WAF_Large' + /// Tier of an application gateway. Possible values + /// are: 'Standard' and 'WAF'. Possible values include: 'Standard', + /// 'WAF' + /// Capacity (instance count) of an application + /// gateway. public ApplicationGatewaySku(string name = default(string), string tier = default(string), int? capacity = default(int?)) { Name = name; @@ -37,7 +45,9 @@ public ApplicationGatewaySku() { } } /// - /// Name of application gateway SKU. Possible values include: + /// Gets or sets name of an application gateway SKU. Possible values + /// are: 'Standard_Small', 'Standard_Medium', 'Standard_Large', + /// 'WAF_Medium', and 'WAF_Large'. Possible values include: /// 'Standard_Small', 'Standard_Medium', 'Standard_Large', /// 'WAF_Medium', 'WAF_Large' /// @@ -45,17 +55,18 @@ public ApplicationGatewaySku() { } public string Name { get; set; } /// - /// Tier of application gateway. Possible values include: 'Standard', - /// 'WAF' + /// Gets or sets tier of an application gateway. Possible values are: + /// 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF' /// [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// Capacity (instance count) of application gateway + /// Gets or sets capacity (instance count) of an application gateway. /// [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs index 53a29d1e5e4f1..c27896f1376da 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySkuName.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewaySkuName. @@ -24,3 +24,4 @@ public static class ApplicationGatewaySkuName public const string WAFLarge = "WAF_Large"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs index 70f836467944e..d876a120f7693 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslCertificate.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// SSL certificates of application gateway + /// SSL certificates of an application gateway. /// [JsonTransformation] public partial class ApplicationGatewaySslCertificate : SubResource @@ -32,6 +32,22 @@ public ApplicationGatewaySslCertificate() { } /// Initializes a new instance of the ApplicationGatewaySslCertificate /// class. /// + /// Resource ID. + /// Base-64 encoded pfx certificate. Only applicable + /// in PUT Request. + /// Password for the pfx file specified in data. + /// Only applicable in PUT request. + /// Base-64 encoded Public cert data + /// corresponding to pfx specified in data. Only applicable in GET + /// request. + /// Provisioning state of the SSL + /// certificate resource Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewaySslCertificate(string id = default(string), string data = default(string), string password = default(string), string publicCertData = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,43 +60,47 @@ public ApplicationGatewaySslCertificate() { } } /// - /// SSL Certificate data + /// Gets or sets base-64 encoded pfx certificate. Only applicable in + /// PUT Request. /// [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } /// - /// SSL Certificate password + /// Gets or sets password for the pfx file specified in data. Only + /// applicable in PUT request. /// [JsonProperty(PropertyName = "properties.password")] public string Password { get; set; } /// - /// SSL Certificate public data + /// Gets or sets base-64 encoded Public cert data corresponding to pfx + /// specified in data. Only applicable in GET request. /// [JsonProperty(PropertyName = "properties.publicCertData")] public string PublicCertData { get; set; } /// - /// Provisioning state of the ssl certificate resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the SSL certificate resource + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs index 8d48f5a16d258..459001255b6bf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslPolicy.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Application gateway SSL policy + /// Application gateway SSL policy. /// public partial class ApplicationGatewaySslPolicy { @@ -31,16 +31,21 @@ public ApplicationGatewaySslPolicy() { } /// Initializes a new instance of the ApplicationGatewaySslPolicy /// class. /// + /// SSL protocols to be disabled on + /// application gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and + /// 'TLSv1_2'. public ApplicationGatewaySslPolicy(IList disabledSslProtocols = default(IList)) { DisabledSslProtocols = disabledSslProtocols; } /// - /// SSL protocols to be disabled on Application Gateway + /// Gets or sets SSL protocols to be disabled on application gateway. + /// Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'. /// [JsonProperty(PropertyName = "disabledSslProtocols")] public IList DisabledSslProtocols { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs index 4d1375da71aaf..12d974b05df5e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewaySslProtocol.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewaySslProtocol. @@ -22,3 +22,4 @@ public static class ApplicationGatewaySslProtocol public const string TLSv12 = "TLSv1_2"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs index 341660c2f1aa8..be6ac6cb41225 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayTier.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ApplicationGatewayTier. @@ -21,3 +21,4 @@ public static class ApplicationGatewayTier public const string WAF = "WAF"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs index 407fbef7b2d05..b549b448381e4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayUrlPathMap.cs @@ -1,23 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// UrlPathMap of application gateway + /// UrlPathMaps give a url path to the backend mapping information for + /// PathBasedRouting. /// [JsonTransformation] public partial class ApplicationGatewayUrlPathMap : SubResource @@ -32,6 +35,20 @@ public ApplicationGatewayUrlPathMap() { } /// Initializes a new instance of the ApplicationGatewayUrlPathMap /// class. /// + /// Resource ID. + /// Default backend address + /// pool resource of URL path map. + /// Default backend http + /// settings resource of URL path map. + /// Path rule of URL path map resource. + /// Provisioning state of the backend + /// http settings resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ApplicationGatewayUrlPathMap(string id = default(string), SubResource defaultBackendAddressPool = default(SubResource), SubResource defaultBackendHttpSettings = default(SubResource), IList pathRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,43 +61,46 @@ public ApplicationGatewayUrlPathMap() { } } /// - /// Default backend address pool resource of URL path map + /// Gets or sets default backend address pool resource of URL path map. /// [JsonProperty(PropertyName = "properties.defaultBackendAddressPool")] public SubResource DefaultBackendAddressPool { get; set; } /// - /// Default backend http settings resource of URL path map + /// Gets or sets default backend http settings resource of URL path + /// map. /// [JsonProperty(PropertyName = "properties.defaultBackendHttpSettings")] public SubResource DefaultBackendHttpSettings { get; set; } /// - /// Path rule of URL path map resource + /// Gets or sets path rule of URL path map resource. /// [JsonProperty(PropertyName = "properties.pathRules")] public IList PathRules { get; set; } /// - /// Provisioning state of the backend http settings resource - /// Updating/Deleting/Failed + /// Gets or sets provisioning state of the backend http settings + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs index 67045b53f2446..a0cd36776df69 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Application gateway web application firewall configuration + /// Application gateway web application firewall configuration. /// public partial class ApplicationGatewayWebApplicationFirewallConfiguration { @@ -31,6 +29,11 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() { } /// Initializes a new instance of the /// ApplicationGatewayWebApplicationFirewallConfiguration class. /// + /// Whether the web application firewall is + /// enabled. + /// Web application firewall mode. Possible + /// values are: 'Detection' and 'Prevention'. Possible values include: + /// 'Detection', 'Prevention' public ApplicationGatewayWebApplicationFirewallConfiguration(bool enabled, string firewallMode = default(string)) { Enabled = enabled; @@ -38,24 +41,28 @@ public ApplicationGatewayWebApplicationFirewallConfiguration() { } } /// - /// Whether web application firewall is enabled + /// Gets or sets whether the web application firewall is enabled. /// [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } /// - /// Web application firewall mode. Possible values include: - /// 'Detection', 'Prevention' + /// Gets or sets web application firewall mode. Possible values are: + /// 'Detection' and 'Prevention'. Possible values include: 'Detection', + /// 'Prevention' /// [JsonProperty(PropertyName = "firewallMode")] public string FirewallMode { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { - //Nothing to validate } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs index dd97c59d5bf8c..28a9e6418434f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AuthorizationUseStatus.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for AuthorizationUseStatus. @@ -21,3 +21,4 @@ public static class AuthorizationUseStatus public const string InUse = "InUse"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs index 2d9844f996231..a1e4a0cb57867 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/AzureAsyncOperationResult.cs @@ -1,30 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// The response body contains the status of the specified asynchronous - /// operation, indicating whether it has succeeded, is in progress, or - /// has failed. Note that this status is distinct from the HTTP status - /// code returned for the Get Operation Status operation itself. If the + /// operation, indicating whether it has succeeded, is in progress, or has + /// failed. Note that this status is distinct from the HTTP status code + /// returned for the Get Operation Status operation itself. If the /// asynchronous operation succeeded, the response body includes the HTTP /// status code for the successful request. If the asynchronous operation - /// failed, the response body includes the HTTP status code for the - /// failed request and error information regarding the failure. + /// failed, the response body includes the HTTP status code for the failed + /// request and error information regarding the failure. /// public partial class AzureAsyncOperationResult { @@ -36,6 +34,9 @@ public AzureAsyncOperationResult() { } /// /// Initializes a new instance of the AzureAsyncOperationResult class. /// + /// Status of the Azure async operation. Possible + /// values are: 'InProgress', 'Succeeded', and 'Failed'. Possible + /// values include: 'InProgress', 'Succeeded', 'Failed' public AzureAsyncOperationResult(string status = default(string), Error error = default(Error)) { Status = status; @@ -43,8 +44,9 @@ public AzureAsyncOperationResult() { } } /// - /// Status of the AzureAsuncOperation. Possible values include: - /// 'InProgress', 'Succeeded', 'Failed' + /// Gets or sets status of the Azure async operation. Possible values + /// are: 'InProgress', 'Succeeded', and 'Failed'. Possible values + /// include: 'InProgress', 'Succeeded', 'Failed' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } @@ -56,3 +58,4 @@ public AzureAsyncOperationResult() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs index ff718a31743c5..6452d7c0d9e32 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BackendAddressPool.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Pool of backend IP addresses + /// Pool of backend IP addresses. /// [JsonTransformation] public partial class BackendAddressPool : SubResource @@ -30,6 +32,21 @@ public BackendAddressPool() { } /// /// Initializes a new instance of the BackendAddressPool class. /// + /// Resource ID. + /// Gets collection of references + /// to IP addresses defined in network interfaces. + /// Gets load balancing rules that use + /// this backend address pool. + /// Gets outbound rules that use this + /// backend address pool. + /// Get provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public BackendAddressPool(string id = default(string), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundNatRule = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,43 +59,45 @@ public BackendAddressPool() { } } /// - /// Gets collection of references to IPs defined in NICs + /// Gets collection of references to IP addresses defined in network + /// interfaces. /// [JsonProperty(PropertyName = "properties.backendIPConfigurations")] - public IList BackendIPConfigurations { get; private set; } + public IList BackendIPConfigurations { get; protected set; } /// - /// Gets Load Balancing rules that use this Backend Address Pool + /// Gets load balancing rules that use this backend address pool. /// [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + public IList LoadBalancingRules { get; protected set; } /// - /// Gets outbound rules that use this Backend Address Pool + /// Gets outbound rules that use this backend address pool. /// [JsonProperty(PropertyName = "properties.outboundNatRule")] - public SubResource OutboundNatRule { get; private set; } + public SubResource OutboundNatRule { get; protected set; } /// - /// Get provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets get provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs index 3169daa9866bc..fb3e207c99128 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/BgpSettings.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class BgpSettings { @@ -26,6 +24,11 @@ public BgpSettings() { } /// /// Initializes a new instance of the BgpSettings class. /// + /// The BGP speaker's ASN. + /// The BGP peering address and BGP + /// identifier of this BGP speaker. + /// The weight added to routes learned from + /// this BGP speaker. public BgpSettings(long? asn = default(long?), string bgpPeeringAddress = default(string), int? peerWeight = default(int?)) { Asn = asn; @@ -34,24 +37,25 @@ public BgpSettings() { } } /// - /// Gets or sets this BGP speaker's ASN + /// Gets or sets the BGP speaker's ASN. /// [JsonProperty(PropertyName = "asn")] public long? Asn { get; set; } /// - /// Gets or sets the BGP peering address and BGP identifier of this - /// BGP speaker + /// Gets or sets the BGP peering address and BGP identifier of this BGP + /// speaker. /// [JsonProperty(PropertyName = "bgpPeeringAddress")] public string BgpPeeringAddress { get; set; } /// /// Gets or sets the weight added to routes learned from this BGP - /// speaker + /// speaker. /// [JsonProperty(PropertyName = "peerWeight")] public int? PeerWeight { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs index debca21a1aacc..a33a93984a014 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionResetSharedKey.cs @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class ConnectionResetSharedKey { @@ -26,31 +25,37 @@ public ConnectionResetSharedKey() { } /// /// Initializes a new instance of the ConnectionResetSharedKey class. /// + /// The virtual network connection reset shared + /// key length, should between 1 and 128. public ConnectionResetSharedKey(int keyLength) { KeyLength = keyLength; } /// - /// The virtual network connection reset shared key length, should - /// between 1 and 128. + /// Gets or sets the virtual network connection reset shared key + /// length, should between 1 and 128. /// [JsonProperty(PropertyName = "keyLength")] public int KeyLength { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { - if (this.KeyLength > 128) + if (KeyLength > 128) { throw new ValidationException(ValidationRules.InclusiveMaximum, "KeyLength", 128); } - if (this.KeyLength < 1) + if (KeyLength < 1) { throw new ValidationException(ValidationRules.InclusiveMinimum, "KeyLength", 1); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs index 378cf17eae8df..eb448c3b7959c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ConnectionSharedKey.cs @@ -1,23 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Response for GetConnectionSharedKey Api service call + /// Response for GetConnectionSharedKey API service call /// public partial class ConnectionSharedKey { @@ -29,20 +28,25 @@ public ConnectionSharedKey() { } /// /// Initializes a new instance of the ConnectionSharedKey class. /// + /// The virtual network connection shared key + /// value. public ConnectionSharedKey(string value) { Value = value; } /// - /// The virtual network connection shared key value + /// Gets or sets the virtual network connection shared key value. /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Value == null) @@ -52,3 +56,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs index df31cd86068c6..c20dfee14ef6e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DhcpOptions.cs @@ -1,24 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// DHCPOptions contains an array of DNS servers available to VMs deployed - /// in the virtual networkStandard DHCP option for a subnet overrides + /// DhcpOptions contains an array of DNS servers available to VMs deployed + /// in the virtual network. Standard DHCP option for a subnet overrides /// VNET DHCP options. /// public partial class DhcpOptions @@ -31,16 +31,19 @@ public DhcpOptions() { } /// /// Initializes a new instance of the DhcpOptions class. /// + /// The list of DNS servers IP + /// addresses. public DhcpOptions(IList dnsServers = default(IList)) { DnsServers = dnsServers; } /// - /// Gets or sets list of DNS servers IP addresses + /// Gets or sets the list of DNS servers IP addresses. /// [JsonProperty(PropertyName = "dnsServers")] public IList DnsServers { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs index 5f8661fc31cf6..023e6d5e62dc2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/DnsNameAvailabilityResult.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Response for CheckDnsNameAvailability Api service call + /// Response for the CheckDnsNameAvailability API service call. /// public partial class DnsNameAvailabilityResult { @@ -29,16 +27,18 @@ public DnsNameAvailabilityResult() { } /// /// Initializes a new instance of the DnsNameAvailabilityResult class. /// + /// Domain availability (True/False). public DnsNameAvailabilityResult(bool? available = default(bool?)) { Available = available; } /// - /// Domain availability (True/False) + /// Gets or sets domain availability (True/False). /// [JsonProperty(PropertyName = "available")] public bool? Available { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs index 26a101149165d..3f33f54aafdee 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroup.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Effective NetworkSecurityGroup + /// Effective network security group. /// public partial class EffectiveNetworkSecurityGroup { @@ -31,6 +31,10 @@ public EffectiveNetworkSecurityGroup() { } /// Initializes a new instance of the EffectiveNetworkSecurityGroup /// class. /// + /// The ID of network security group + /// that is applied. + /// A collection of effective + /// security rules. public EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup = default(SubResource), EffectiveNetworkSecurityGroupAssociation association = default(EffectiveNetworkSecurityGroupAssociation), IList effectiveSecurityRules = default(IList)) { NetworkSecurityGroup = networkSecurityGroup; @@ -39,7 +43,7 @@ public EffectiveNetworkSecurityGroup() { } } /// - /// Gets the id of network security group that is applied + /// Gets or sets the ID of network security group that is applied. /// [JsonProperty(PropertyName = "networkSecurityGroup")] public SubResource NetworkSecurityGroup { get; set; } @@ -50,10 +54,11 @@ public EffectiveNetworkSecurityGroup() { } public EffectiveNetworkSecurityGroupAssociation Association { get; set; } /// - /// Gets collection of effective security rules + /// Gets or sets a collection of effective security rules. /// [JsonProperty(PropertyName = "effectiveSecurityRules")] public IList EffectiveSecurityRules { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 48c96248db113..f8a1c05786675 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Effective NetworkSecurityGroup association + /// The effective network security group association. /// public partial class EffectiveNetworkSecurityGroupAssociation { @@ -31,6 +29,9 @@ public EffectiveNetworkSecurityGroupAssociation() { } /// Initializes a new instance of the /// EffectiveNetworkSecurityGroupAssociation class. /// + /// The ID of the subnet if assigned. + /// The ID of the network interface if + /// assigned. public EffectiveNetworkSecurityGroupAssociation(SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) { Subnet = subnet; @@ -38,16 +39,17 @@ public EffectiveNetworkSecurityGroupAssociation() { } } /// - /// Gets the id of subnet if assigned + /// Gets or sets the ID of the subnet if assigned. /// [JsonProperty(PropertyName = "subnet")] public SubResource Subnet { get; set; } /// - /// Gets the id of network interface if assigned + /// Gets or sets the ID of the network interface if assigned. /// [JsonProperty(PropertyName = "networkInterface")] public SubResource NetworkInterface { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs index 23ea2b9fd7d84..7231595d76d18 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Response for list effective network security groups api service call + /// Response for list effective network security groups API service call. /// public partial class EffectiveNetworkSecurityGroupListResult { @@ -31,6 +31,10 @@ public EffectiveNetworkSecurityGroupListResult() { } /// Initializes a new instance of the /// EffectiveNetworkSecurityGroupListResult class. /// + /// A list of effective network security + /// groups. + /// The URL to get the next set of + /// results. public EffectiveNetworkSecurityGroupListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; @@ -38,16 +42,17 @@ public EffectiveNetworkSecurityGroupListResult() { } } /// - /// Gets list of effective network security groups + /// Gets or sets a list of effective network security groups. /// [JsonProperty(PropertyName = "value")] public IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs index 79cdcdc78dc1b..887580cdda48b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveNetworkSecurityRule.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Effective NetworkSecurityRules + /// Effective network security rules. /// public partial class EffectiveNetworkSecurityRule { @@ -31,6 +31,29 @@ public EffectiveNetworkSecurityRule() { } /// Initializes a new instance of the EffectiveNetworkSecurityRule /// class. /// + /// The name of the security rule specified by the + /// user (if created by the user). + /// The network protocol this rule applies to. + /// Possible values are: 'Tcp', 'Udp', and '*'. Possible values + /// include: 'Tcp', 'Udp', '*' + /// The source port or range. + /// The destination port or + /// range. + /// The source address + /// prefix. + /// The destination address + /// prefix. + /// The expanded source + /// address prefix. + /// Expanded destination + /// address prefix. + /// Whether network traffic is allowed or denied. + /// Possible values are: 'Allow' and 'Deny'. Possible values include: + /// 'Allow', 'Deny' + /// The priority of the rule. + /// The direction of the rule. Possible values + /// are: 'Inbound and Outbound'. Possible values include: 'Inbound', + /// 'Outbound' public EffectiveNetworkSecurityRule(string name = default(string), string protocol = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), string sourceAddressPrefix = default(string), string destinationAddressPrefix = default(string), IList expandedSourceAddressPrefix = default(IList), IList expandedDestinationAddressPrefix = default(IList), string access = default(string), int? priority = default(int?), string direction = default(string)) { Name = name; @@ -47,74 +70,78 @@ public EffectiveNetworkSecurityRule() { } } /// - /// Gets the name of the security rule specified by the user (if - /// created by the user) + /// Gets or sets the name of the security rule specified by the user + /// (if created by the user). /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets Network protocol this rule applies to. Possible values - /// include: 'Tcp', 'Udp', '*' + /// Gets or sets the network protocol this rule applies to. Possible + /// values are: 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', + /// 'Udp', '*' /// [JsonProperty(PropertyName = "protocol")] public string Protocol { get; set; } /// - /// Gets source port or range + /// Gets or sets the source port or range. /// [JsonProperty(PropertyName = "sourcePortRange")] public string SourcePortRange { get; set; } /// - /// Gets destination port or range + /// Gets or sets the destination port or range. /// [JsonProperty(PropertyName = "destinationPortRange")] public string DestinationPortRange { get; set; } /// - /// Gets source address prefix + /// Gets or sets the source address prefix. /// [JsonProperty(PropertyName = "sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// - /// Gets destination address prefix + /// Gets or sets the destination address prefix. /// [JsonProperty(PropertyName = "destinationAddressPrefix")] public string DestinationAddressPrefix { get; set; } /// - /// Gets expanded source address prefix + /// Gets or sets the expanded source address prefix. /// [JsonProperty(PropertyName = "expandedSourceAddressPrefix")] public IList ExpandedSourceAddressPrefix { get; set; } /// - /// Gets expanded destination address prefix + /// Gets or sets expanded destination address prefix. /// [JsonProperty(PropertyName = "expandedDestinationAddressPrefix")] public IList ExpandedDestinationAddressPrefix { get; set; } /// - /// Gets network traffic is allowed or denied. Possible values - /// include: 'Allow', 'Deny' + /// Gets or sets whether network traffic is allowed or denied. Possible + /// values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + /// 'Deny' /// [JsonProperty(PropertyName = "access")] public string Access { get; set; } /// - /// Gets the priority of the rule + /// Gets or sets the priority of the rule. /// [JsonProperty(PropertyName = "priority")] public int? Priority { get; set; } /// - /// Gets the direction of the rule. Possible values include: - /// 'Inbound', 'Outbound' + /// Gets or sets the direction of the rule. Possible values are: + /// 'Inbound and Outbound'. Possible values include: 'Inbound', + /// 'Outbound' /// [JsonProperty(PropertyName = "direction")] public string Direction { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs index 5a0f2366fbe8d..386d8f5dd28e1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRoute.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// Effective Route @@ -29,6 +29,24 @@ public EffectiveRoute() { } /// /// Initializes a new instance of the EffectiveRoute class. /// + /// The name of the user defined route. This is + /// optional. + /// Who created the route. Possible values are: + /// 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible + /// values include: 'Unknown', 'User', 'VirtualNetworkGateway', + /// 'Default' + /// The value of effective route. Possible values + /// are: 'Active' and 'Invalid'. Possible values include: 'Active', + /// 'Invalid' + /// The address prefixes of the effective + /// routes in CIDR notation. + /// The IP address of the next hop of + /// the effective route. + /// The type of Azure hop the packet should + /// be sent to. Possible values are: 'VirtualNetworkGateway', + /// 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible + /// values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' public EffectiveRoute(string name = default(string), string source = default(string), string state = default(string), IList addressPrefix = default(IList), IList nextHopIpAddress = default(IList), string nextHopType = default(string)) { Name = name; @@ -40,44 +58,50 @@ public EffectiveRoute() { } } /// - /// Gets the name of the user defined route. This is optional. + /// Gets or sets the name of the user defined route. This is optional. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets who created the route. Possible values include: 'Unknown', - /// 'User', 'VirtualNetworkGateway', 'Default' + /// Gets or sets who created the route. Possible values are: 'Unknown', + /// 'User', 'VirtualNetworkGateway', and 'Default'. Possible values + /// include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' /// [JsonProperty(PropertyName = "source")] public string Source { get; set; } /// - /// Gets value of effective route. Possible values include: 'Active', + /// Gets or sets the value of effective route. Possible values are: + /// 'Active' and 'Invalid'. Possible values include: 'Active', /// 'Invalid' /// [JsonProperty(PropertyName = "state")] public string State { get; set; } /// - /// Gets address prefixes of the effective routes in CIDR notation. + /// Gets or sets the address prefixes of the effective routes in CIDR + /// notation. /// [JsonProperty(PropertyName = "addressPrefix")] public IList AddressPrefix { get; set; } /// - /// Gets the IP address of the next hop of the effective route + /// Gets or sets the IP address of the next hop of the effective route. /// [JsonProperty(PropertyName = "nextHopIpAddress")] public IList NextHopIpAddress { get; set; } /// /// Gets or sets the type of Azure hop the packet should be sent to. - /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', - /// 'Internet', 'VirtualAppliance', 'None' + /// Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + /// 'Internet', 'VirtualAppliance', and 'None'. Possible values + /// include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' /// [JsonProperty(PropertyName = "nextHopType")] public string NextHopType { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs index 2e2cf7dde98db..b199d6b3416ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteListResult.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Response for list effective route api service call + /// Response for list effective route API service call. /// public partial class EffectiveRouteListResult { @@ -29,6 +29,9 @@ public EffectiveRouteListResult() { } /// /// Initializes a new instance of the EffectiveRouteListResult class. /// + /// A list of effective routes. + /// The URL to get the next set of + /// results. public EffectiveRouteListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; @@ -36,16 +39,17 @@ public EffectiveRouteListResult() { } } /// - /// Gets list of effective routes + /// Gets or sets a list of effective routes. /// [JsonProperty(PropertyName = "value")] public IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs index c186c024848f1..b18f6be707129 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteSource.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for EffectiveRouteSource. @@ -23,3 +23,4 @@ public static class EffectiveRouteSource public const string Default = "Default"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs index 0961ccc1fc1bb..efe29040f987d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/EffectiveRouteState.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for EffectiveRouteState. @@ -21,3 +21,4 @@ public static class EffectiveRouteState public const string Invalid = "Invalid"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs index 65df22a40cea0..96d02120f6b0f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Error.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class Error { @@ -62,3 +62,4 @@ public Error() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs index 79165ef59f48e..3191b4f350fd9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ErrorDetails.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class ErrorDetails { @@ -50,3 +48,4 @@ public ErrorDetails() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs index 381f65b133512..b6fb752601e30 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuit.cs @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// ExpressRouteCircuit resource @@ -30,6 +32,34 @@ public ExpressRouteCircuit() { } /// /// Initializes a new instance of the ExpressRouteCircuit class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The SKU. + /// Allow classic + /// operations + /// The CircuitProvisioningState + /// state of the resource. + /// The + /// ServiceProviderProvisioningState state of the resource. Possible + /// values are 'NotProvisioned', 'Provisioning', 'Provisioned', and + /// 'Deprovisioning'. Possible values include: 'NotProvisioned', + /// 'Provisioning', 'Provisioned', 'Deprovisioning' + /// The list of authorizations. + /// The list of peerings. + /// The ServiceKey. + /// The + /// ServiceProviderNotes. + /// The + /// ServiceProviderProperties. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The GatewayManager Etag. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. public ExpressRouteCircuit(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ExpressRouteCircuitSku sku = default(ExpressRouteCircuitSku), bool? allowClassicOperations = default(bool?), string circuitProvisioningState = default(string), string serviceProviderProvisioningState = default(string), IList authorizations = default(IList), IList peerings = default(IList), string serviceKey = default(string), string serviceProviderNotes = default(string), ExpressRouteCircuitServiceProviderProperties serviceProviderProperties = default(ExpressRouteCircuitServiceProviderProperties), string provisioningState = default(string), string gatewayManagerEtag = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -48,80 +78,82 @@ public ExpressRouteCircuit() { } } /// - /// Gets or sets sku + /// Gets or sets the SKU. /// [JsonProperty(PropertyName = "sku")] public ExpressRouteCircuitSku Sku { get; set; } /// - /// allow classic operations + /// Gets or sets allow classic operations /// [JsonProperty(PropertyName = "properties.allowClassicOperations")] public bool? AllowClassicOperations { get; set; } /// - /// Gets or sets CircuitProvisioningState state of the resource + /// Gets or sets the CircuitProvisioningState state of the resource. /// [JsonProperty(PropertyName = "properties.circuitProvisioningState")] public string CircuitProvisioningState { get; set; } /// - /// Gets or sets ServiceProviderProvisioningState state of the - /// resource . Possible values include: 'NotProvisioned', - /// 'Provisioning', 'Provisioned', 'Deprovisioning' + /// Gets or sets the ServiceProviderProvisioningState state of the + /// resource. Possible values are 'NotProvisioned', 'Provisioning', + /// 'Provisioned', and 'Deprovisioning'. Possible values include: + /// 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' /// [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] public string ServiceProviderProvisioningState { get; set; } /// - /// Gets or sets list of authorizations + /// Gets or sets the list of authorizations. /// [JsonProperty(PropertyName = "properties.authorizations")] public IList Authorizations { get; set; } /// - /// Gets or sets list of peerings + /// Gets or sets the list of peerings. /// [JsonProperty(PropertyName = "properties.peerings")] public IList Peerings { get; set; } /// - /// Gets or sets ServiceKey + /// Gets or sets the ServiceKey. /// [JsonProperty(PropertyName = "properties.serviceKey")] public string ServiceKey { get; set; } /// - /// Gets or sets ServiceProviderNotes + /// Gets or sets the ServiceProviderNotes. /// [JsonProperty(PropertyName = "properties.serviceProviderNotes")] public string ServiceProviderNotes { get; set; } /// - /// Gets or sets ServiceProviderProperties + /// Gets or sets the ServiceProviderProperties. /// [JsonProperty(PropertyName = "properties.serviceProviderProperties")] public ExpressRouteCircuitServiceProviderProperties ServiceProviderProperties { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets or sets the GatewayManager Etag + /// Gets or sets the GatewayManager Etag. /// [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs index 359df6d5d4009..86c032f1a7867 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitArpTable.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// The arp table associated with the ExpressRouteCircuit + /// The ARP table associated with the ExpressRouteCircuit. /// public partial class ExpressRouteCircuitArpTable { @@ -31,6 +29,10 @@ public ExpressRouteCircuitArpTable() { } /// Initializes a new instance of the ExpressRouteCircuitArpTable /// class. /// + /// Age + /// Interface + /// The IP address. + /// The MAC address. public ExpressRouteCircuitArpTable(int? age = default(int?), string interfaceProperty = default(string), string ipAddress = default(string), string macAddress = default(string)) { Age = age; @@ -40,28 +42,29 @@ public ExpressRouteCircuitArpTable() { } } /// - /// Age. + /// Gets or sets age /// [JsonProperty(PropertyName = "age")] public int? Age { get; set; } /// - /// Interface. + /// Gets or sets interface /// [JsonProperty(PropertyName = "interface")] public string InterfaceProperty { get; set; } /// - /// Gets ipAddress. + /// Gets or sets the IP address. /// [JsonProperty(PropertyName = "ipAddress")] public string IpAddress { get; set; } /// - /// Gets macAddress. + /// Gets or sets the MAC address. /// [JsonProperty(PropertyName = "macAddress")] public string MacAddress { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs index 4ac09862d7a46..6ede41b3e1ed7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitAuthorization.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Authorization in a ExpressRouteCircuit resource + /// Authorization in an ExpressRouteCircuit resource. /// [JsonTransformation] public partial class ExpressRouteCircuitAuthorization : SubResource @@ -32,6 +32,19 @@ public ExpressRouteCircuitAuthorization() { } /// Initializes a new instance of the ExpressRouteCircuitAuthorization /// class. /// + /// Resource ID. + /// The authorization key. + /// AuthorizationUseStatus. + /// Possible values are: 'Available' and 'InUse'. Possible values + /// include: 'Available', 'InUse' + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ExpressRouteCircuitAuthorization(string id = default(string), string authorizationKey = default(string), string authorizationUseStatus = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -43,38 +56,40 @@ public ExpressRouteCircuitAuthorization() { } } /// - /// Gets or sets the authorization key + /// Gets or sets the authorization key. /// [JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } /// - /// Gets or sets AuthorizationUseStatus. Possible values include: - /// 'Available', 'InUse' + /// Gets or sets authorizationUseStatus. Possible values are: + /// 'Available' and 'InUse'. Possible values include: 'Available', + /// 'InUse' /// [JsonProperty(PropertyName = "properties.authorizationUseStatus")] public string AuthorizationUseStatus { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs index 59a0272b64c82..8a7777209dca4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Peering in a ExpressRouteCircuit resource + /// Peering in an ExpressRouteCircuit resource. /// [JsonTransformation] public partial class ExpressRouteCircuitPeering : SubResource @@ -30,6 +30,38 @@ public ExpressRouteCircuitPeering() { } /// /// Initializes a new instance of the ExpressRouteCircuitPeering class. /// + /// Resource ID. + /// The PeeringType. Possible values are: + /// 'AzurePublicPeering', 'AzurePrivatePeering', and + /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', + /// 'AzurePrivatePeering', 'MicrosoftPeering' + /// The state of peering. Possible values are: + /// 'Disabled' and 'Enbaled'. Possible values include: 'Disabled', + /// 'Enabled' + /// The Azure ASN. + /// The peer ASN. + /// The primary address + /// prefix. + /// The secondary address + /// prefix. + /// The primary port. + /// The secondary port. + /// The shared key. + /// The VLAN ID. + /// The Microsoft peering + /// configuration. + /// Gets peering stats. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The GatewayManager Etag. + /// Gets whether the provider or the + /// customer last modified the peering. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ExpressRouteCircuitPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), int? peerASN = default(int?), string primaryPeerAddressPrefix = default(string), string secondaryPeerAddressPrefix = default(string), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), string sharedKey = default(string), int? vlanId = default(int?), ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default(ExpressRouteCircuitPeeringConfig), ExpressRouteCircuitStats stats = default(ExpressRouteCircuitStats), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -53,111 +85,115 @@ public ExpressRouteCircuitPeering() { } } /// - /// Gets or sets PeeringType. Possible values include: - /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// Gets or sets the PeeringType. Possible values are: + /// 'AzurePublicPeering', 'AzurePrivatePeering', and + /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', + /// 'AzurePrivatePeering', 'MicrosoftPeering' /// [JsonProperty(PropertyName = "properties.peeringType")] public string PeeringType { get; set; } /// - /// Gets or sets state of Peering. Possible values include: - /// 'Disabled', 'Enabled' + /// Gets or sets the state of peering. Possible values are: 'Disabled' + /// and 'Enbaled'. Possible values include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "properties.state")] public string State { get; set; } /// - /// Gets or sets the azure ASN + /// Gets or sets the Azure ASN. /// [JsonProperty(PropertyName = "properties.azureASN")] public int? AzureASN { get; set; } /// - /// Gets or sets the peer ASN + /// Gets or sets the peer ASN. /// [JsonProperty(PropertyName = "properties.peerASN")] public int? PeerASN { get; set; } /// - /// Gets or sets the primary address prefix + /// Gets or sets the primary address prefix. /// [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] public string PrimaryPeerAddressPrefix { get; set; } /// - /// Gets or sets the secondary address prefix + /// Gets or sets the secondary address prefix. /// [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] public string SecondaryPeerAddressPrefix { get; set; } /// - /// Gets or sets the primary port + /// Gets or sets the primary port. /// [JsonProperty(PropertyName = "properties.primaryAzurePort")] public string PrimaryAzurePort { get; set; } /// - /// Gets or sets the secondary port + /// Gets or sets the secondary port. /// [JsonProperty(PropertyName = "properties.secondaryAzurePort")] public string SecondaryAzurePort { get; set; } /// - /// Gets or sets the shared key + /// Gets or sets the shared key. /// [JsonProperty(PropertyName = "properties.sharedKey")] public string SharedKey { get; set; } /// - /// Gets or sets the vlan id + /// Gets or sets the VLAN ID. /// [JsonProperty(PropertyName = "properties.vlanId")] public int? VlanId { get; set; } /// - /// Gets or sets the mircosoft peering config + /// Gets or sets the Microsoft peering configuration. /// [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } /// - /// Gets or peering stats + /// Gets peering stats. /// [JsonProperty(PropertyName = "properties.stats")] public ExpressRouteCircuitStats Stats { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets or sets the GatewayManager Etag + /// Gets or sets the GatewayManager Etag. /// [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] public string GatewayManagerEtag { get; set; } /// - /// Gets whether the provider or the customer last modified the peering + /// Gets whether the provider or the customer last modified the + /// peering. /// [JsonProperty(PropertyName = "properties.lastModifiedBy")] public string LastModifiedBy { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs index 8b35c3dc882f6..582e721e1e54d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for @@ -24,3 +24,4 @@ public static class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState public const string ValidationNeeded = "ValidationNeeded"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs index c05cc3d2675cd..7a1858827dc34 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringConfig.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Specifies the peering config + /// Specifies the peering configuration. /// public partial class ExpressRouteCircuitPeeringConfig { @@ -31,6 +31,17 @@ public ExpressRouteCircuitPeeringConfig() { } /// Initializes a new instance of the ExpressRouteCircuitPeeringConfig /// class. /// + /// The reference of + /// AdvertisedPublicPrefixes. + /// AdvertisedPublicPrefixState of + /// the Peering resource. Possible values are 'NotConfigured', + /// 'Configuring', 'Configured', and 'ValidationNeeded'. Possible + /// values include: 'NotConfigured', 'Configuring', 'Configured', + /// 'ValidationNeeded' + /// The CustomerASN of the peering. + /// The RoutingRegistryName of the + /// configuration. public ExpressRouteCircuitPeeringConfig(IList advertisedPublicPrefixes = default(IList), string advertisedPublicPrefixesState = default(string), int? customerASN = default(int?), string routingRegistryName = default(string)) { AdvertisedPublicPrefixes = advertisedPublicPrefixes; @@ -40,30 +51,32 @@ public ExpressRouteCircuitPeeringConfig() { } } /// - /// Gets or sets the reference of AdvertisedPublicPrefixes + /// Gets or sets the reference of AdvertisedPublicPrefixes. /// [JsonProperty(PropertyName = "advertisedPublicPrefixes")] public IList AdvertisedPublicPrefixes { get; set; } /// - /// Gets or sets AdvertisedPublicPrefixState of the Peering resource . - /// Possible values include: 'NotConfigured', 'Configuring', - /// 'Configured', 'ValidationNeeded' + /// Gets or sets advertisedPublicPrefixState of the Peering resource. + /// Possible values are 'NotConfigured', 'Configuring', 'Configured', + /// and 'ValidationNeeded'. Possible values include: 'NotConfigured', + /// 'Configuring', 'Configured', 'ValidationNeeded' /// [JsonProperty(PropertyName = "advertisedPublicPrefixesState")] public string AdvertisedPublicPrefixesState { get; set; } /// - /// Gets or Sets CustomerAsn of the peering. + /// Gets or sets the CustomerASN of the peering. /// [JsonProperty(PropertyName = "customerASN")] public int? CustomerASN { get; set; } /// - /// Gets or Sets RoutingRegistryName of the config. + /// Gets or sets the RoutingRegistryName of the configuration. /// [JsonProperty(PropertyName = "routingRegistryName")] public string RoutingRegistryName { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs index 6f8c1d2047f31..e1a0518e98d7e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringState.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitPeeringState. @@ -21,3 +21,4 @@ public static class ExpressRouteCircuitPeeringState public const string Enabled = "Enabled"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs index baac3d9ffb392..f48709b1b17d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitPeeringType. @@ -22,3 +22,4 @@ public static class ExpressRouteCircuitPeeringType public const string MicrosoftPeering = "MicrosoftPeering"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs index 83f6f8ab343c1..914591760cea6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTable.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// The routes table associated with the ExpressRouteCircuit @@ -31,6 +29,11 @@ public ExpressRouteCircuitRoutesTable() { } /// Initializes a new instance of the ExpressRouteCircuitRoutesTable /// class. /// + /// network + /// nextHop + /// locPrf + /// weight. + /// path public ExpressRouteCircuitRoutesTable(string network = default(string), string nextHop = default(string), string locPrf = default(string), int? weight = default(int?), string path = default(string)) { Network = network; @@ -41,34 +44,35 @@ public ExpressRouteCircuitRoutesTable() { } } /// - /// network. + /// Gets or sets network /// [JsonProperty(PropertyName = "network")] public string Network { get; set; } /// - /// nextHop + /// Gets or sets nextHop /// [JsonProperty(PropertyName = "nextHop")] public string NextHop { get; set; } /// - /// locPrf. + /// Gets or sets locPrf /// [JsonProperty(PropertyName = "locPrf")] public string LocPrf { get; set; } /// - /// weight. + /// Gets or sets weight. /// [JsonProperty(PropertyName = "weight")] public int? Weight { get; set; } /// - /// path . + /// Gets or sets path /// [JsonProperty(PropertyName = "path")] public string Path { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs index 03256243a9c3c..7d633e9989141 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitRoutesTableSummary.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// The routes table associated with the ExpressRouteCircuit + /// The routes table associated with the ExpressRouteCircuit. /// public partial class ExpressRouteCircuitRoutesTableSummary { @@ -31,6 +29,15 @@ public ExpressRouteCircuitRoutesTableSummary() { } /// Initializes a new instance of the /// ExpressRouteCircuitRoutesTableSummary class. /// + /// Neighbor + /// BGP version number spoken to the neighbor. + /// Autonomous system number. + /// The length of time that the BGP session has + /// been in the Established state, or the current status if not in the + /// Established state. + /// Current state of the BGP session, and the + /// number of prefixes that have been received from a neighbor or peer + /// group. public ExpressRouteCircuitRoutesTableSummary(string neighbor = default(string), int? v = default(int?), int? asProperty = default(int?), string upDown = default(string), string statePfxRcd = default(string)) { Neighbor = neighbor; @@ -41,37 +48,38 @@ public ExpressRouteCircuitRoutesTableSummary() { } } /// - /// Neighbor. + /// Gets or sets neighbor /// [JsonProperty(PropertyName = "neighbor")] public string Neighbor { get; set; } /// - /// BGP version number spoken to the neighbor. + /// Gets or sets BGP version number spoken to the neighbor. /// [JsonProperty(PropertyName = "v")] public int? V { get; set; } /// - /// Autonomous system number. + /// Gets or sets autonomous system number. /// [JsonProperty(PropertyName = "as")] public int? AsProperty { get; set; } /// - /// The length of time that the BGP session has been in the - /// Established state, or the current status if not in the + /// Gets or sets the length of time that the BGP session has been in + /// the Established state, or the current status if not in the /// Established state. /// [JsonProperty(PropertyName = "upDown")] public string UpDown { get; set; } /// - /// Current state of the BGP session, and the number of prefixes that - /// have been received from a neighbor or peer group. + /// Gets or sets current state of the BGP session, and the number of + /// prefixes that have been received from a neighbor or peer group. /// [JsonProperty(PropertyName = "statePfxRcd")] public string StatePfxRcd { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs index 2a20f0d26d396..47cbbdb608cdf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitServiceProviderProperties.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Contains ServiceProviderProperties in an ExpressRouteCircuit + /// Contains ServiceProviderProperties in an ExpressRouteCircuit. /// public partial class ExpressRouteCircuitServiceProviderProperties { @@ -31,6 +29,9 @@ public ExpressRouteCircuitServiceProviderProperties() { } /// Initializes a new instance of the /// ExpressRouteCircuitServiceProviderProperties class. /// + /// The serviceProviderName. + /// The peering location. + /// The BandwidthInMbps. public ExpressRouteCircuitServiceProviderProperties(string serviceProviderName = default(string), string peeringLocation = default(string), int? bandwidthInMbps = default(int?)) { ServiceProviderName = serviceProviderName; @@ -39,22 +40,23 @@ public ExpressRouteCircuitServiceProviderProperties() { } } /// - /// Gets or sets serviceProviderName. + /// Gets or sets the serviceProviderName. /// [JsonProperty(PropertyName = "serviceProviderName")] public string ServiceProviderName { get; set; } /// - /// Gets or sets peering location. + /// Gets or sets the peering location. /// [JsonProperty(PropertyName = "peeringLocation")] public string PeeringLocation { get; set; } /// - /// Gets or sets BandwidthInMbps. + /// Gets or sets the BandwidthInMbps. /// [JsonProperty(PropertyName = "bandwidthInMbps")] public int? BandwidthInMbps { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs index 02a90ea17e45a..a03f6b61511f2 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSku.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Contains sku in an ExpressRouteCircuit + /// Contains SKU in an ExpressRouteCircuit. /// public partial class ExpressRouteCircuitSku { @@ -29,6 +27,13 @@ public ExpressRouteCircuitSku() { } /// /// Initializes a new instance of the ExpressRouteCircuitSku class. /// + /// The name of the SKU. + /// The tier of the SKU. Possible values are + /// 'Standard' and 'Premium'. Possible values include: 'Standard', + /// 'Premium' + /// The family of the SKU. Possible values are: + /// 'UnlimitedData' and 'MeteredData'. Possible values include: + /// 'UnlimitedData', 'MeteredData' public ExpressRouteCircuitSku(string name = default(string), string tier = default(string), string family = default(string)) { Name = name; @@ -37,20 +42,21 @@ public ExpressRouteCircuitSku() { } } /// - /// Gets or sets name of the sku. + /// Gets or sets the name of the SKU. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets tier of the sku. Possible values include: 'Standard', - /// 'Premium' + /// Gets or sets the tier of the SKU. Possible values are 'Standard' + /// and 'Premium'. Possible values include: 'Standard', 'Premium' /// [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// Gets or sets family of the sku. Possible values include: + /// Gets or sets the family of the SKU. Possible values are: + /// 'UnlimitedData' and 'MeteredData'. Possible values include: /// 'UnlimitedData', 'MeteredData' /// [JsonProperty(PropertyName = "family")] @@ -58,3 +64,4 @@ public ExpressRouteCircuitSku() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs index d5d7f2f3da506..37da3f35d382f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuFamily.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitSkuFamily. @@ -21,3 +21,4 @@ public static class ExpressRouteCircuitSkuFamily public const string MeteredData = "MeteredData"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs index a77ddcf7863dc..67a63c5ee3db9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitSkuTier.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ExpressRouteCircuitSkuTier. @@ -21,3 +21,4 @@ public static class ExpressRouteCircuitSkuTier public const string Premium = "Premium"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs index 0df96d3e5863d..74e2a7ffaa946 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitStats.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Contains Stats associated with the peering + /// Contains stats associated with the peering. /// public partial class ExpressRouteCircuitStats { @@ -29,6 +27,11 @@ public ExpressRouteCircuitStats() { } /// /// Initializes a new instance of the ExpressRouteCircuitStats class. /// + /// Gets BytesIn of the peering. + /// Gets BytesOut of the peering. + /// Gets BytesIn of the peering. + /// Gets BytesOut of the + /// peering. public ExpressRouteCircuitStats(long? primarybytesIn = default(long?), long? primarybytesOut = default(long?), long? secondarybytesIn = default(long?), long? secondarybytesOut = default(long?)) { PrimarybytesIn = primarybytesIn; @@ -63,3 +66,4 @@ public ExpressRouteCircuitStats() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs index 2660f612a16b6..e0975b0e53b01 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsArpTableListResult.cs @@ -1,24 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// Response for ListArpTable associated with the Express Route Circuits - /// Api + /// API. /// public partial class ExpressRouteCircuitsArpTableListResult { @@ -32,6 +32,9 @@ public ExpressRouteCircuitsArpTableListResult() { } /// Initializes a new instance of the /// ExpressRouteCircuitsArpTableListResult class. /// + /// Gets list of the ARP table. + /// The URL to get the next set of + /// results. public ExpressRouteCircuitsArpTableListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; @@ -39,16 +42,17 @@ public ExpressRouteCircuitsArpTableListResult() { } } /// - /// Gets List of ArpTable + /// Gets list of the ARP table. /// [JsonProperty(PropertyName = "value")] public IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs index 33c992071ef7d..05c7af405a1ba 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableListResult.cs @@ -1,24 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Response for ListRoutesTable associated with the Express Route - /// Circuits Api + /// Response for ListRoutesTable associated with the Express Route Circuits + /// API. /// public partial class ExpressRouteCircuitsRoutesTableListResult { @@ -32,6 +32,9 @@ public ExpressRouteCircuitsRoutesTableListResult() { } /// Initializes a new instance of the /// ExpressRouteCircuitsRoutesTableListResult class. /// + /// The list of routes table. + /// The URL to get the next set of + /// results. public ExpressRouteCircuitsRoutesTableListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; @@ -39,16 +42,17 @@ public ExpressRouteCircuitsRoutesTableListResult() { } } /// - /// Gets List of RoutesTable + /// Gets or sets the list of routes table. /// [JsonProperty(PropertyName = "value")] public IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs index 3e04ebb317ecb..4e40d46f9ae39 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteCircuitsRoutesTableSummaryListResult.cs @@ -1,24 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Response for ListRoutesTable associated with the Express Route - /// Circuits Api + /// Response for ListRoutesTable associated with the Express Route Circuits + /// API. /// public partial class ExpressRouteCircuitsRoutesTableSummaryListResult { @@ -32,6 +32,9 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() { } /// Initializes a new instance of the /// ExpressRouteCircuitsRoutesTableSummaryListResult class. /// + /// A list of the routes table. + /// The URL to get the next set of + /// results. public ExpressRouteCircuitsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; @@ -39,16 +42,17 @@ public ExpressRouteCircuitsRoutesTableSummaryListResult() { } } /// - /// Gets List of RoutesTable + /// Gets or sets a list of the routes table. /// [JsonProperty(PropertyName = "value")] public IList Value { get; set; } /// - /// Gets the URL to get the next set of results. + /// Gets or sets the URL to get the next set of results. /// [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs index 9dee4f989b124..6b517df75aea5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProvider.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// ExpressRouteResourceProvider object + /// A ExpressRouteResourceProvider object. /// [JsonTransformation] public partial class ExpressRouteServiceProvider : Resource @@ -32,6 +34,16 @@ public ExpressRouteServiceProvider() { } /// Initializes a new instance of the ExpressRouteServiceProvider /// class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Get a list of peering + /// locations. + /// Gets bandwidths offered. + /// Gets the provisioning state of the + /// resource. public ExpressRouteServiceProvider(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList peeringLocations = default(IList), IList bandwidthsOffered = default(IList), string provisioningState = default(string)) : base(id, name, type, location, tags) { @@ -41,22 +53,23 @@ public ExpressRouteServiceProvider() { } } /// - /// Gets or list of peering locations + /// Gets or sets get a list of peering locations. /// [JsonProperty(PropertyName = "properties.peeringLocations")] public IList PeeringLocations { get; set; } /// - /// Gets or bandwidths offered + /// Gets bandwidths offered. /// [JsonProperty(PropertyName = "properties.bandwidthsOffered")] public IList BandwidthsOffered { get; set; } /// - /// Gets provisioning state of the resource + /// Gets the provisioning state of the resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs index cf9b936fbcf60..f8a1a744bd7f8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ExpressRouteServiceProviderBandwidthsOffered.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Contains Bandwidths offered in ExpressRouteServiceProviders + /// Contains bandwidths offered in ExpressRouteServiceProvider resources. /// public partial class ExpressRouteServiceProviderBandwidthsOffered { @@ -31,6 +29,8 @@ public ExpressRouteServiceProviderBandwidthsOffered() { } /// Initializes a new instance of the /// ExpressRouteServiceProviderBandwidthsOffered class. /// + /// The OfferName. + /// The ValueInMbps. public ExpressRouteServiceProviderBandwidthsOffered(string offerName = default(string), int? valueInMbps = default(int?)) { OfferName = offerName; @@ -38,16 +38,17 @@ public ExpressRouteServiceProviderBandwidthsOffered() { } } /// - /// Gets the OfferName + /// Gets or sets the OfferName. /// [JsonProperty(PropertyName = "offerName")] public string OfferName { get; set; } /// - /// Gets the ValueInMbps. + /// Gets or sets the ValueInMbps. /// [JsonProperty(PropertyName = "valueInMbps")] public int? ValueInMbps { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs index 992a650f63941..19cc79dce0f51 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/FrontendIpConfiguration.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Frontend IP address of the load balancer + /// Frontend IP address of the load balancer. /// [JsonTransformation] public partial class FrontendIPConfiguration : SubResource @@ -30,6 +32,31 @@ public FrontendIPConfiguration() { } /// /// Initializes a new instance of the FrontendIPConfiguration class. /// + /// Resource ID. + /// Read only. Inbound rules URIs that + /// use this frontend IP. + /// Read only. Inbound pools URIs that + /// use this frontend IP. + /// Read only. Outbound rules URIs that + /// use this frontend IP. + /// Gets load balancing rules URIs + /// that use this frontend IP. + /// The private IP address of the IP + /// configuration. + /// The Private IP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The reference of the subnet resource. + /// The reference of the Public IP + /// resource. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public FrontendIPConfiguration(string id = default(string), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), IList loadBalancingRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -47,74 +74,76 @@ public FrontendIPConfiguration() { } } /// - /// Read only. Inbound rules URIs that use this frontend IP + /// Gets read only. Inbound rules URIs that use this frontend IP. /// [JsonProperty(PropertyName = "properties.inboundNatRules")] - public IList InboundNatRules { get; private set; } + public IList InboundNatRules { get; protected set; } /// - /// Read only. Inbound pools URIs that use this frontend IP + /// Gets read only. Inbound pools URIs that use this frontend IP. /// [JsonProperty(PropertyName = "properties.inboundNatPools")] - public IList InboundNatPools { get; private set; } + public IList InboundNatPools { get; protected set; } /// - /// Read only. Outbound rules URIs that use this frontend IP + /// Gets read only. Outbound rules URIs that use this frontend IP. /// [JsonProperty(PropertyName = "properties.outboundNatRules")] - public IList OutboundNatRules { get; private set; } + public IList OutboundNatRules { get; protected set; } /// - /// Gets Load Balancing rules URIs that use this frontend IP + /// Gets load balancing rules URIs that use this frontend IP. /// [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + public IList LoadBalancingRules { get; protected set; } /// - /// Gets or sets the privateIPAddress of the IP Configuration + /// Gets or sets the private IP address of the IP configuration. /// [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets the Private IP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets the reference of the subnet resource + /// Gets or sets the reference of the subnet resource. /// [JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// - /// Gets or sets the reference of the PublicIP resource + /// Gets or sets the reference of the Public IP resource. /// [JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs index d223939059995..518d5bb3535dc 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPAddressAvailabilityResult.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Response for CheckIPAddressAvailability Api service call + /// Response for CheckIPAddressAvailability API service call /// public partial class IPAddressAvailabilityResult { @@ -31,6 +31,9 @@ public IPAddressAvailabilityResult() { } /// Initializes a new instance of the IPAddressAvailabilityResult /// class. /// + /// Private IP address availability. + /// Contains other available private + /// IP addresses if the asked for address is taken. public IPAddressAvailabilityResult(bool? available = default(bool?), IList availableIPAddresses = default(IList)) { Available = available; @@ -38,17 +41,18 @@ public IPAddressAvailabilityResult() { } } /// - /// Private IP address availability + /// Gets or sets private IP address availability. /// [JsonProperty(PropertyName = "available")] public bool? Available { get; set; } /// - /// Contains other available private IP addresses if the asked for - /// address is taken + /// Gets or sets contains other available private IP addresses if the + /// asked for address is taken. /// [JsonProperty(PropertyName = "availableIPAddresses")] public IList AvailableIPAddresses { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs index abfc74fc76dc1..fb80c5bef36f4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPConfiguration.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// IPConfiguration @@ -30,6 +30,23 @@ public IPConfiguration() { } /// /// Initializes a new instance of the IPConfiguration class. /// + /// Resource ID. + /// The private IP address of the IP + /// configuration. + /// The private IP allocation + /// method. Possible values are 'Static' and 'Dynamic'. Possible values + /// include: 'Static', 'Dynamic' + /// The reference of the subnet resource. + /// The reference of the public IP + /// resource. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public IPConfiguration(string id = default(string), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), Subnet subnet = default(Subnet), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -43,50 +60,52 @@ public IPConfiguration() { } } /// - /// Gets or sets the privateIPAddress of the IP Configuration + /// Gets or sets the private IP address of the IP configuration. /// [JsonProperty(PropertyName = "properties.privateIPAddress")] public string PrivateIPAddress { get; set; } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets the private IP allocation method. Possible values are + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets the reference of the subnet resource + /// Gets or sets the reference of the subnet resource. /// [JsonProperty(PropertyName = "properties.subnet")] public Subnet Subnet { get; set; } /// - /// Gets or sets the reference of the PublicIP resource + /// Gets or sets the reference of the public IP resource. /// [JsonProperty(PropertyName = "properties.publicIPAddress")] public PublicIPAddress PublicIPAddress { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs index b10e14230d1bf..d008da6d80000 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IPVersion.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for IPVersion. @@ -21,3 +21,4 @@ public static class IPVersion public const string IPv6 = "IPv6"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs index a6710086ae4ad..a3565fe07601d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatPool.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Inbound NAT pool of the load balancer + /// Inbound NAT pool of the load balancer. /// [JsonTransformation] public partial class InboundNatPool : SubResource @@ -30,6 +30,30 @@ public InboundNatPool() { } /// /// Initializes a new instance of the InboundNatPool class. /// + /// The transport protocol for the endpoint. + /// Possible values are: 'Udp' or 'Tcp'. Possible values include: + /// 'Udp', 'Tcp' + /// The first port number in the + /// range of external ports that will be used to provide Inbound Nat to + /// NICs associated with a load balancer. Acceptable values range + /// between 1 and 65534. + /// The last port number in the + /// range of external ports that will be used to provide Inbound Nat to + /// NICs associated with a load balancer. Acceptable values range + /// between 1 and 65535. + /// The port used for internal connections on + /// the endpoint. Acceptable values are between 1 and 65535. + /// Resource ID. + /// A reference to frontend IP + /// addresses. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public InboundNatPool(string protocol, int frontendPortRangeStart, int frontendPortRangeEnd, int backendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,74 +68,68 @@ public InboundNatPool() { } } /// - /// Gets or sets a reference to frontend IP Addresses + /// Gets or sets a reference to frontend IP addresses. /// [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// /// Gets or sets the transport protocol for the endpoint. Possible - /// values are Udp or Tcp. Possible values include: 'Udp', 'Tcp' + /// values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' /// [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets the starting port range for the NAT pool. You can - /// specify any port number you choose, but the port numbers - /// specified for each role in the service must be unique. Possible - /// values range between 1 and 65535, inclusive + /// Gets or sets the first port number in the range of external ports + /// that will be used to provide Inbound Nat to NICs associated with a + /// load balancer. Acceptable values range between 1 and 65534. /// [JsonProperty(PropertyName = "properties.frontendPortRangeStart")] public int FrontendPortRangeStart { get; set; } /// - /// Gets or sets the ending port range for the NAT pool. You can - /// specify any port number you choose, but the port numbers - /// specified for each role in the service must be unique. Possible - /// values range between 1 and 65535, inclusive + /// Gets or sets the last port number in the range of external ports + /// that will be used to provide Inbound Nat to NICs associated with a + /// load balancer. Acceptable values range between 1 and 65535. /// [JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] public int FrontendPortRangeEnd { get; set; } /// - /// Gets or sets a port used for internal connections on the endpoint. - /// The localPort attribute maps the eternal port of the endpoint to - /// an internal port on a role. This is useful in scenarios where a - /// role must communicate to an internal component on a port that is - /// different from the one that is exposed externally. If not - /// specified, the value of localPort is the same as the port - /// attribute. Set the value of localPort to '*' to automatically - /// assign an unallocated port that is discoverable using the runtime - /// API + /// Gets or sets the port used for internal connections on the + /// endpoint. Acceptable values are between 1 and 65535. /// [JsonProperty(PropertyName = "properties.backendPort")] public int BackendPort { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) @@ -121,3 +139,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs index 5801e26994c58..2728fc967c549 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/InboundNatRule.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Inbound NAT rule of the loadbalancer + /// Inbound NAT rule of the load balancer. /// [JsonTransformation] public partial class InboundNatRule : SubResource @@ -30,6 +30,38 @@ public InboundNatRule() { } /// /// Initializes a new instance of the InboundNatRule class. /// + /// Resource ID. + /// A reference to frontend IP + /// addresses. + /// A reference to a private IP + /// address defined on a network interface of a VM. Traffic sent to the + /// frontend port of each of the frontend IP configurations is + /// forwarded to the backed IP. + /// The transport protocol for the endpoint. + /// Possible values are: 'Udp' or 'Tcp'. Possible values include: + /// 'Udp', 'Tcp' + /// The port for the external endpoint. Port + /// numbers for each Rule must be unique within the Load Balancer. + /// Acceptable values range from 1 to 65534. + /// The port used for the internal endpoint. + /// Acceptable values range from 1 to 65535. + /// The timeout for the TCP idle + /// connection. The value can be set between 4 and 30 minutes. The + /// default value is 4 minutes. This element is only used when the + /// protocol is set to TCP. + /// Configures a virtual machine's + /// endpoint for the floating IP capability required to configure a SQL + /// AlwaysOn Availability Group. This setting is required when using + /// the SQL AlwaysOn Availability Groups in SQL server. This setting + /// can't be changed after you create the endpoint. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public InboundNatRule(string id = default(string), SubResource frontendIPConfiguration = default(SubResource), NetworkInterfaceIPConfiguration backendIPConfiguration = default(NetworkInterfaceIPConfiguration), string protocol = default(string), int? frontendPort = default(int?), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -46,87 +78,80 @@ public InboundNatRule() { } } /// - /// Gets or sets a reference to frontend IP Addresses + /// Gets or sets a reference to frontend IP addresses. /// [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// - /// Gets or sets a reference to a private ip address defined on a - /// NetworkInterface of a VM. Traffic sent to frontendPort of each of - /// the frontendIPConfigurations is forwarded to the backed IP + /// Gets a reference to a private IP address defined on a network + /// interface of a VM. Traffic sent to the frontend port of each of the + /// frontend IP configurations is forwarded to the backed IP. /// [JsonProperty(PropertyName = "properties.backendIPConfiguration")] - public NetworkInterfaceIPConfiguration BackendIPConfiguration { get; private set; } + public NetworkInterfaceIPConfiguration BackendIPConfiguration { get; protected set; } /// /// Gets or sets the transport protocol for the endpoint. Possible - /// values are Udp or Tcp. Possible values include: 'Udp', 'Tcp' + /// values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' /// [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets the port for the external endpoint. You can specify - /// any port number you choose, but the port numbers specified for - /// each role in the service must be unique. Possible values range - /// between 1 and 65535, inclusive + /// Gets or sets the port for the external endpoint. Port numbers for + /// each Rule must be unique within the Load Balancer. Acceptable + /// values range from 1 to 65534. /// [JsonProperty(PropertyName = "properties.frontendPort")] public int? FrontendPort { get; set; } /// - /// Gets or sets a port used for internal connections on the endpoint. - /// The localPort attribute maps the eternal port of the endpoint to - /// an internal port on a role. This is useful in scenarios where a - /// role must communicate to an internal component on a port that is - /// different from the one that is exposed externally. If not - /// specified, the value of localPort is the same as the port - /// attribute. Set the value of localPort to '*' to automatically - /// assign an unallocated port that is discoverable using the runtime - /// API + /// Gets or sets the port used for the internal endpoint. Acceptable + /// values range from 1 to 65535. /// [JsonProperty(PropertyName = "properties.backendPort")] public int? BackendPort { get; set; } /// - /// Gets or sets the timeout for the Tcp idle connection. The value - /// can be set between 4 and 30 minutes. The default value is 4 - /// minutes. This element is only used when the protocol is set to Tcp + /// Gets or sets the timeout for the TCP idle connection. The value can + /// be set between 4 and 30 minutes. The default value is 4 minutes. + /// This element is only used when the protocol is set to TCP. /// [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// - /// Configures a virtual machine's endpoint for the floating IP - /// capability required to configure a SQL AlwaysOn availability - /// Group. This setting is required when using the SQL Always ON - /// availability Groups in SQL server. This setting can't be changed - /// after you create the endpoint + /// Gets or sets configures a virtual machine's endpoint for the + /// floating IP capability required to configure a SQL AlwaysOn + /// Availability Group. This setting is required when using the SQL + /// AlwaysOn Availability Groups in SQL server. This setting can't be + /// changed after you create the endpoint. /// [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs index 22c9f0ea660bf..00fe60b7214ef 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/IpAllocationMethod.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for IPAllocationMethod. @@ -21,3 +21,4 @@ public static class IPAllocationMethod public const string Dynamic = "Dynamic"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs index a0bfcf917522b..55f054bb227f6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancer.cs @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// LoadBalancer resource @@ -30,6 +32,44 @@ public LoadBalancer() { } /// /// Initializes a new instance of the LoadBalancer class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Object representing the + /// frontend IPs to be used for the load balancer + /// Collection of backend address + /// pools used by a load balancer + /// Object collection representing the + /// load balancing rules Gets the provisioning + /// Collection of probe objects used in the load + /// balancer + /// Collection of inbound NAT Rules used + /// by a load balancer. Defining inbound NAT rules on your load + /// balancer is mutually exclusive with defining an inbound NAT pool. + /// Inbound NAT pools are referenced from virtual machine scale sets. + /// NICs that are associated with individual virtual machines cannot + /// reference an Inbound NAT pool. They have to reference individual + /// inbound NAT rules. + /// Defines an external port range for + /// inbound NAT to a single backend port on NICs associated with a load + /// balancer. Inbound NAT rules are created automatically for each NIC + /// associated with the Load Balancer using an external port from this + /// range. Defining an Inbound NAT pool on your Load Balancer is + /// mutually exclusive with defining inbound Nat rules. Inbound NAT + /// pools are referenced from virtual machine scale sets. NICs that are + /// associated with individual virtual machines cannot reference an + /// inbound NAT pool. They have to reference individual inbound NAT + /// rules. + /// The outbound NAT rules. + /// The resource GUID property of the load + /// balancer resource. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. public LoadBalancer(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList frontendIPConfigurations = default(IList), IList backendAddressPools = default(IList), IList loadBalancingRules = default(IList), IList probes = default(IList), IList inboundNatRules = default(IList), IList inboundNatPools = default(IList), IList outboundNatRules = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -46,66 +86,86 @@ public LoadBalancer() { } } /// - /// Gets or sets frontend IP addresses of the load balancer + /// Gets or sets object representing the frontend IPs to be used for + /// the load balancer /// [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] public IList FrontendIPConfigurations { get; set; } /// - /// Gets or sets Pools of backend IP addresses + /// Gets or sets collection of backend address pools used by a load + /// balancer /// [JsonProperty(PropertyName = "properties.backendAddressPools")] public IList BackendAddressPools { get; set; } /// - /// Gets or sets load balancing rules + /// Gets or sets object collection representing the load balancing + /// rules Gets the provisioning /// [JsonProperty(PropertyName = "properties.loadBalancingRules")] public IList LoadBalancingRules { get; set; } /// - /// Gets or sets list of Load balancer probes + /// Gets or sets collection of probe objects used in the load balancer /// [JsonProperty(PropertyName = "properties.probes")] public IList Probes { get; set; } /// - /// Gets or sets list of inbound rules + /// Gets or sets collection of inbound NAT Rules used by a load + /// balancer. Defining inbound NAT rules on your load balancer is + /// mutually exclusive with defining an inbound NAT pool. Inbound NAT + /// pools are referenced from virtual machine scale sets. NICs that are + /// associated with individual virtual machines cannot reference an + /// Inbound NAT pool. They have to reference individual inbound NAT + /// rules. /// [JsonProperty(PropertyName = "properties.inboundNatRules")] public IList InboundNatRules { get; set; } /// - /// Gets or sets inbound NAT pools + /// Gets or sets defines an external port range for inbound NAT to a + /// single backend port on NICs associated with a load balancer. + /// Inbound NAT rules are created automatically for each NIC associated + /// with the Load Balancer using an external port from this range. + /// Defining an Inbound NAT pool on your Load Balancer is mutually + /// exclusive with defining inbound Nat rules. Inbound NAT pools are + /// referenced from virtual machine scale sets. NICs that are + /// associated with individual virtual machines cannot reference an + /// inbound NAT pool. They have to reference individual inbound NAT + /// rules. /// [JsonProperty(PropertyName = "properties.inboundNatPools")] public IList InboundNatPools { get; set; } /// - /// Gets or sets outbound NAT rules + /// Gets or sets the outbound NAT rules. /// [JsonProperty(PropertyName = "properties.outboundNatRules")] public IList OutboundNatRules { get; set; } /// - /// Gets or sets resource guid property of the Load balancer resource + /// Gets or sets the resource GUID property of the load balancer + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs index ac324b11c1911..6839f761c1e6d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadBalancingRule.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Rules of the load balancer + /// A loag balancing rule for a load balancer. /// [JsonTransformation] public partial class LoadBalancingRule : SubResource @@ -30,6 +30,43 @@ public LoadBalancingRule() { } /// /// Initializes a new instance of the LoadBalancingRule class. /// + /// The transport protocol for the external + /// endpoint. Possible values are 'Udp' or 'Tcp'. Possible values + /// include: 'Udp', 'Tcp' + /// The port for the external endpoint. Port + /// numbers for each Rule must be unique within the Load Balancer. + /// Acceptable values are between 1 and 65534. + /// Resource ID. + /// A reference to frontend IP + /// addresses. + /// A reference to a pool of DIPs. + /// Inbound traffic is randomly load balanced across IPs in the backend + /// IPs. + /// The reference of the load balancer probe used + /// by the load balancing rule. + /// The load distribution policy for + /// this rule. Possible values are 'Default', 'SourceIP', and + /// 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', + /// 'SourceIPProtocol' + /// The port used for internal connections on + /// the endpoint. Acceptable values are between 1 and 65535. + /// The timeout for the TCP idle + /// connection. The value can be set between 4 and 30 minutes. The + /// default value is 4 minutes. This element is only used when the + /// protocol is set to TCP. + /// Configures a virtual machine's + /// endpoint for the floating IP capability required to configure a SQL + /// AlwaysOn Availability Group. This setting is required when using + /// the SQL AlwaysOn Availability Groups in SQL server. This setting + /// can't be changed after you create the endpoint. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), SubResource probe = default(SubResource), string loadDistribution = default(string), int? backendPort = default(int?), int? idleTimeoutInMinutes = default(int?), bool? enableFloatingIP = default(bool?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -48,28 +85,28 @@ public LoadBalancingRule() { } } /// - /// Gets or sets a reference to frontend IP Addresses + /// Gets or sets a reference to frontend IP addresses. /// [JsonProperty(PropertyName = "properties.frontendIPConfiguration")] public SubResource FrontendIPConfiguration { get; set; } /// - /// Gets or sets a reference to a pool of DIPs. Inbound traffic is - /// randomly load balanced across IPs in the backend IPs + /// Gets or sets a reference to a pool of DIPs. Inbound traffic is + /// randomly load balanced across IPs in the backend IPs. /// [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// /// Gets or sets the reference of the load balancer probe used by the - /// Load Balancing rule. + /// load balancing rule. /// [JsonProperty(PropertyName = "properties.probe")] public SubResource Probe { get; set; } /// /// Gets or sets the transport protocol for the external endpoint. - /// Possible values are Udp or Tcp. Possible values include: 'Udp', + /// Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', /// 'Tcp' /// [JsonProperty(PropertyName = "properties.protocol")] @@ -77,76 +114,72 @@ public LoadBalancingRule() { } /// /// Gets or sets the load distribution policy for this rule. Possible + /// values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible /// values include: 'Default', 'SourceIP', 'SourceIPProtocol' /// [JsonProperty(PropertyName = "properties.loadDistribution")] public string LoadDistribution { get; set; } /// - /// Gets or sets the port for the external endpoint. You can specify - /// any port number you choose, but the port numbers specified for - /// each role in the service must be unique. Possible values range - /// between 1 and 65535, inclusive + /// Gets or sets the port for the external endpoint. Port numbers for + /// each Rule must be unique within the Load Balancer. Acceptable + /// values are between 1 and 65534. /// [JsonProperty(PropertyName = "properties.frontendPort")] public int FrontendPort { get; set; } /// - /// Gets or sets a port used for internal connections on the endpoint. - /// The localPort attribute maps the eternal port of the endpoint to - /// an internal port on a role. This is useful in scenarios where a - /// role must communicate to an internal component on a port that is - /// different from the one that is exposed externally. If not - /// specified, the value of localPort is the same as the port - /// attribute. Set the value of localPort to '*' to automatically - /// assign an unallocated port that is discoverable using the runtime - /// API + /// Gets or sets the port used for internal connections on the + /// endpoint. Acceptable values are between 1 and 65535. /// [JsonProperty(PropertyName = "properties.backendPort")] public int? BackendPort { get; set; } /// - /// Gets or sets the timeout for the Tcp idle connection. The value - /// can be set between 4 and 30 minutes. The default value is 4 - /// minutes. This element is only used when the protocol is set to Tcp + /// Gets or sets the timeout for the TCP idle connection. The value can + /// be set between 4 and 30 minutes. The default value is 4 minutes. + /// This element is only used when the protocol is set to TCP. /// [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// - /// Configures a virtual machine's endpoint for the floating IP - /// capability required to configure a SQL AlwaysOn availability - /// Group. This setting is required when using the SQL Always ON - /// availability Groups in SQL server. This setting can't be changed - /// after you create the endpoint + /// Gets or sets configures a virtual machine's endpoint for the + /// floating IP capability required to configure a SQL AlwaysOn + /// Availability Group. This setting is required when using the SQL + /// AlwaysOn Availability Groups in SQL server. This setting can't be + /// changed after you create the endpoint. /// [JsonProperty(PropertyName = "properties.enableFloatingIP")] public bool? EnableFloatingIP { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) @@ -156,3 +189,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs index dd75b710fa05c..80c2d72404e03 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LoadDistribution.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for LoadDistribution. @@ -22,3 +22,4 @@ public static class LoadDistribution public const string SourceIPProtocol = "SourceIPProtocol"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs index a2b8d3bdca8c5..e64b047c1e974 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/LocalNetworkGateway.cs @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// A common class for general resource information @@ -30,6 +32,24 @@ public LocalNetworkGateway() { } /// /// Initializes a new instance of the LocalNetworkGateway class. /// + /// Local network site address + /// space. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// IP address of local network + /// gateway. + /// Local network gateway's BGP speaker + /// settings. + /// The resource GUID property of the + /// LocalNetworkGateway resource. + /// The provisioning state of the + /// LocalNetworkGateway resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. public LocalNetworkGateway(AddressSpace localNetworkAddressSpace, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string gatewayIpAddress = default(string), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -42,47 +62,50 @@ public LocalNetworkGateway() { } } /// - /// Local network site Address space + /// Gets or sets local network site address space. /// [JsonProperty(PropertyName = "properties.localNetworkAddressSpace")] public AddressSpace LocalNetworkAddressSpace { get; set; } /// - /// IP address of local network gateway. + /// Gets or sets IP address of local network gateway. /// [JsonProperty(PropertyName = "properties.gatewayIpAddress")] public string GatewayIpAddress { get; set; } /// - /// Local network gateway's BGP speaker settings + /// Gets or sets local network gateway's BGP speaker settings. /// [JsonProperty(PropertyName = "properties.bgpSettings")] public BgpSettings BgpSettings { get; set; } /// - /// Gets or sets resource guid property of the LocalNetworkGateway - /// resource + /// Gets or sets the resource GUID property of the LocalNetworkGateway + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the LocalNetworkGateway resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the LocalNetworkGateway resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (LocalNetworkAddressSpace == null) @@ -92,3 +115,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs index 559b970694087..4ce1300cdac89 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterface.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// A NetworkInterface in a resource group + /// A network interface in a resource group. /// [JsonTransformation] public partial class NetworkInterface : Resource @@ -30,6 +32,34 @@ public NetworkInterface() { } /// /// Initializes a new instance of the NetworkInterface class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The reference of a virtual + /// machine. + /// The reference of the + /// NetworkSecurityGroup resource. + /// A list of IPConfigurations of the + /// network interface. + /// The DNS settings in network + /// interface. + /// The MAC address of the network + /// interface. + /// Gets whether this is a primary network + /// interface on a virtual machine. + /// If the network interface + /// is accelerated networking enabled. + /// Indicates whether IP forwarding is + /// enabled on this network interface. + /// The resource GUID property of the + /// network interface resource. + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. public NetworkInterface(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SubResource virtualMachine = default(SubResource), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), IList ipConfigurations = default(IList), NetworkInterfaceDnsSettings dnsSettings = default(NetworkInterfaceDnsSettings), string macAddress = default(string), bool? primary = default(bool?), bool? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -47,74 +77,77 @@ public NetworkInterface() { } } /// - /// Gets or sets the reference of a VirtualMachine + /// Gets or sets the reference of a virtual machine. /// [JsonProperty(PropertyName = "properties.virtualMachine")] public SubResource VirtualMachine { get; set; } /// - /// Gets or sets the reference of the NetworkSecurityGroup resource + /// Gets or sets the reference of the NetworkSecurityGroup resource. /// [JsonProperty(PropertyName = "properties.networkSecurityGroup")] public NetworkSecurityGroup NetworkSecurityGroup { get; set; } /// - /// Gets or sets list of IPConfigurations of the network interface + /// Gets or sets a list of IPConfigurations of the network interface. /// [JsonProperty(PropertyName = "properties.ipConfigurations")] public IList IpConfigurations { get; set; } /// - /// Gets or sets DNS settings in network interface + /// Gets or sets the DNS settings in network interface. /// [JsonProperty(PropertyName = "properties.dnsSettings")] public NetworkInterfaceDnsSettings DnsSettings { get; set; } /// - /// Gets the MAC address of the network interface + /// Gets or sets the MAC address of the network interface. /// [JsonProperty(PropertyName = "properties.macAddress")] public string MacAddress { get; set; } /// - /// Gets whether this is a primary NIC on a virtual machine + /// Gets whether this is a primary network interface on a virtual + /// machine. /// [JsonProperty(PropertyName = "properties.primary")] public bool? Primary { get; set; } /// /// Gets or sets if the network interface is accelerated networking - /// enabled + /// enabled. /// [JsonProperty(PropertyName = "properties.enableAcceleratedNetworking")] public bool? EnableAcceleratedNetworking { get; set; } /// - /// Gets or sets whether IPForwarding is enabled on the NIC + /// Gets or sets indicates whether IP forwarding is enabled on this + /// network interface. /// [JsonProperty(PropertyName = "properties.enableIPForwarding")] public bool? EnableIPForwarding { get; set; } /// - /// Gets or sets resource guid property of the network interface - /// resource + /// Gets or sets the resource GUID property of the network interface + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs index ae71b6f362145..92ca0e62c8da1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceDnsSettings.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Dns settings of a network interface + /// DNS settings of a network interface. /// public partial class NetworkInterfaceDnsSettings { @@ -31,6 +31,25 @@ public NetworkInterfaceDnsSettings() { } /// Initializes a new instance of the NetworkInterfaceDnsSettings /// class. /// + /// List of DNS servers IP addresses. Use + /// 'AzureProvidedDNS' to switch to azure provided DNS resolution. + /// 'AzureProvidedDNS' value cannot be combined with other IPs, it must + /// be the only value in dnsServers collection. + /// If the VM that uses this NIC is + /// part of an Availability Set, then this list will have the union of + /// all DNS servers from all NICs that are part of the Availability + /// Set. This property is what is configured on each of those + /// VMs. + /// Relative DNS name for this NIC + /// used for internal communications between VMs in the same virtual + /// network. + /// Fully qualified DNS name supporting + /// internal communications between VMs in the same virtual + /// network. + /// Even if internalDnsNameLabel + /// is not specified, a DNS entry is created for the primary NIC of the + /// VM. This DNS name can be constructed by concatenating the VM name + /// with the value of internalDomainNameSuffix. public NetworkInterfaceDnsSettings(IList dnsServers = default(IList), IList appliedDnsServers = default(IList), string internalDnsNameLabel = default(string), string internalFqdn = default(string), string internalDomainNameSuffix = default(string)) { DnsServers = dnsServers; @@ -41,34 +60,46 @@ public NetworkInterfaceDnsSettings() { } } /// - /// Gets or sets list of DNS servers IP addresses + /// Gets or sets list of DNS servers IP addresses. Use + /// 'AzureProvidedDNS' to switch to azure provided DNS resolution. + /// 'AzureProvidedDNS' value cannot be combined with other IPs, it must + /// be the only value in dnsServers collection. /// [JsonProperty(PropertyName = "dnsServers")] public IList DnsServers { get; set; } /// - /// Gets or sets list of Applied DNS servers IP addresses + /// Gets or sets if the VM that uses this NIC is part of an + /// Availability Set, then this list will have the union of all DNS + /// servers from all NICs that are part of the Availability Set. This + /// property is what is configured on each of those VMs. /// [JsonProperty(PropertyName = "appliedDnsServers")] public IList AppliedDnsServers { get; set; } /// - /// Gets or sets the internal DNS name + /// Gets or sets relative DNS name for this NIC used for internal + /// communications between VMs in the same virtual network. /// [JsonProperty(PropertyName = "internalDnsNameLabel")] public string InternalDnsNameLabel { get; set; } /// - /// Gets or sets the internal fqdn. + /// Gets or sets fully qualified DNS name supporting internal + /// communications between VMs in the same virtual network. /// [JsonProperty(PropertyName = "internalFqdn")] public string InternalFqdn { get; set; } /// - /// Gets or sets internal domain name suffix of the NIC. + /// Gets or sets even if internalDnsNameLabel is not specified, a DNS + /// entry is created for the primary NIC of the VM. This DNS name can + /// be constructed by concatenating the VM name with the value of + /// internalDomainNameSuffix. /// [JsonProperty(PropertyName = "internalDomainNameSuffix")] public string InternalDomainNameSuffix { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs index f16872a50433c..1a340c0fc1665 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkInterfaceIpConfiguration.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// IPConfiguration in a NetworkInterface + /// IPConfiguration in a network interface. /// [JsonTransformation] public partial class NetworkInterfaceIPConfiguration : SubResource @@ -32,6 +34,28 @@ public NetworkInterfaceIPConfiguration() { } /// Initializes a new instance of the NetworkInterfaceIPConfiguration /// class. /// + /// Resource ID. + /// The reference + /// of ApplicationGatewayBackendAddressPool resource. + /// The reference of + /// LoadBalancerBackendAddressPool resource. + /// A list of references of + /// LoadBalancerInboundNatRules. + /// Defines how a private IP + /// address is assigned. Possible values are: 'Static' and 'Dynamic'. + /// Possible values include: 'Static', 'Dynamic' + /// Available from Api-Version + /// 2016-03-30 onwards, it represents whether the specific + /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: + /// 'IPv4', 'IPv6' + /// Gets whether this is a primary customer + /// address on the network interface. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public NetworkInterfaceIPConfiguration(string id = default(string), IList applicationGatewayBackendAddressPools = default(IList), IList loadBalancerBackendAddressPools = default(IList), IList loadBalancerInboundNatRules = default(IList), string privateIPAddress = default(string), string privateIPAllocationMethod = default(string), string privateIPAddressVersion = default(string), Subnet subnet = default(Subnet), bool? primary = default(bool?), PublicIPAddress publicIPAddress = default(PublicIPAddress), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -51,20 +75,20 @@ public NetworkInterfaceIPConfiguration() { } /// /// Gets or sets the reference of ApplicationGatewayBackendAddressPool - /// resource + /// resource. /// [JsonProperty(PropertyName = "properties.applicationGatewayBackendAddressPools")] public IList ApplicationGatewayBackendAddressPools { get; set; } /// /// Gets or sets the reference of LoadBalancerBackendAddressPool - /// resource + /// resource. /// [JsonProperty(PropertyName = "properties.loadBalancerBackendAddressPools")] public IList LoadBalancerBackendAddressPools { get; set; } /// - /// Gets or sets list of references of LoadBalancerInboundNatRules + /// Gets or sets a list of references of LoadBalancerInboundNatRules. /// [JsonProperty(PropertyName = "properties.loadBalancerInboundNatRules")] public IList LoadBalancerInboundNatRules { get; set; } @@ -75,15 +99,18 @@ public NetworkInterfaceIPConfiguration() { } public string PrivateIPAddress { get; set; } /// - /// Gets or sets PrivateIP allocation method. Possible values include: + /// Gets or sets defines how a private IP address is assigned. Possible + /// values are: 'Static' and 'Dynamic'. Possible values include: /// 'Static', 'Dynamic' /// [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets PrivateIP address version (IPv4/IPv6). Possible - /// values include: 'IPv4', 'IPv6' + /// Gets or sets available from Api-Version 2016-03-30 onwards, it + /// represents whether the specific ipconfiguration is IPv4 or IPv6. + /// Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + /// Possible values include: 'IPv4', 'IPv6' /// [JsonProperty(PropertyName = "properties.privateIPAddressVersion")] public string PrivateIPAddressVersion { get; set; } @@ -94,7 +121,8 @@ public NetworkInterfaceIPConfiguration() { } public Subnet Subnet { get; set; } /// - /// Gets whether this is a primary customer address on the NIC + /// Gets whether this is a primary customer address on the network + /// interface. /// [JsonProperty(PropertyName = "properties.primary")] public bool? Primary { get; set; } @@ -110,18 +138,19 @@ public NetworkInterfaceIPConfiguration() { } public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs index cc6c78127fb52..945fa6fe974c0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkOperationStatus.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for NetworkOperationStatus. @@ -22,3 +22,4 @@ public static class NetworkOperationStatus public const string Failed = "Failed"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs index 3873ae2d563b0..0b61b27e9f845 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/NetworkSecurityGroup.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// NetworkSecurityGroup resource + /// NetworkSecurityGroup resource. /// [JsonTransformation] public partial class NetworkSecurityGroup : Resource @@ -30,6 +32,26 @@ public NetworkSecurityGroup() { } /// /// Initializes a new instance of the NetworkSecurityGroup class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A collection of security rules of the + /// network security group. + /// The default security rules of + /// network security group. + /// A collection of references to + /// network interfaces. + /// A collection of references to + /// subnets. + /// The resource GUID property of the + /// network security group resource. + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. public NetworkSecurityGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList securityRules = default(IList), IList defaultSecurityRules = default(IList), IList networkInterfaces = default(IList), IList subnets = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -43,49 +65,51 @@ public NetworkSecurityGroup() { } } /// - /// Gets or sets security rules of network security group + /// Gets or sets a collection of security rules of the network security + /// group. /// [JsonProperty(PropertyName = "properties.securityRules")] public IList SecurityRules { get; set; } /// - /// Gets or default security rules of network security group + /// Gets or sets the default security rules of network security group. /// [JsonProperty(PropertyName = "properties.defaultSecurityRules")] public IList DefaultSecurityRules { get; set; } /// - /// Gets collection of references to Network Interfaces + /// Gets a collection of references to network interfaces. /// [JsonProperty(PropertyName = "properties.networkInterfaces")] - public IList NetworkInterfaces { get; private set; } + public IList NetworkInterfaces { get; protected set; } /// - /// Gets collection of references to subnets + /// Gets a collection of references to subnets. /// [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + public IList Subnets { get; protected set; } /// - /// Gets or sets resource guid property of the network security group - /// resource + /// Gets or sets the resource GUID property of the network security + /// group resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs index 0c452c0911666..16bd512c248bd 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/OutboundNatRule.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Outbound NAT pool of the load balancer + /// Outbound NAT pool of the load balancer. /// [JsonTransformation] public partial class OutboundNatRule : SubResource @@ -30,6 +32,22 @@ public OutboundNatRule() { } /// /// Initializes a new instance of the OutboundNatRule class. /// + /// A reference to a pool of DIPs. + /// Outbound traffic is randomly load balanced across IPs in the + /// backend IPs. + /// Resource ID. + /// The number of outbound ports + /// to be used for NAT. + /// The Frontend IP addresses of + /// the load balancer. + /// Gets the provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public OutboundNatRule(SubResource backendAddressPool, string id = default(string), int? allocatedOutboundPorts = default(int?), IList frontendIPConfigurations = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,48 +60,51 @@ public OutboundNatRule() { } } /// - /// Gets or sets the number of outbound ports to be used for SNAT + /// Gets or sets the number of outbound ports to be used for NAT. /// [JsonProperty(PropertyName = "properties.allocatedOutboundPorts")] public int? AllocatedOutboundPorts { get; set; } /// - /// Gets or sets Frontend IP addresses of the load balancer + /// Gets or sets the Frontend IP addresses of the load balancer. /// [JsonProperty(PropertyName = "properties.frontendIPConfigurations")] public IList FrontendIPConfigurations { get; set; } /// /// Gets or sets a reference to a pool of DIPs. Outbound traffic is - /// randomly load balanced across IPs in the backend IPs + /// randomly load balanced across IPs in the backend IPs. /// [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the PublicIP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (BackendAddressPool == null) @@ -93,3 +114,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs index 1e3a78d4e1eee..f5a47fff73b27 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Page.cs @@ -1,17 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System.Collections.Generic; - using System.Linq; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Azure; using Newtonsoft.Json; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. @@ -35,16 +39,17 @@ public class Page : IPage /// A an enumerator that can be used to iterate through the collection. public IEnumerator GetEnumerator() { - return (Items == null) ? Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs index c64b49d6ab888..d39aaca80d44b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Probe.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Load balancer Probe + /// A load balancer probe. /// [JsonTransformation] public partial class Probe : SubResource @@ -30,6 +32,38 @@ public Probe() { } /// /// Initializes a new instance of the Probe class. /// + /// The protocol of the end point. Possible + /// values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK + /// is required for the probe to be successful. If 'Http' is specified, + /// a 200 OK response from the specifies URI is required for the probe + /// to be successful. Possible values include: 'Http', 'Tcp' + /// The port for communicating the probe. Possible + /// values range from 1 to 65535, inclusive. + /// Resource ID. + /// The load balancer rules that use + /// this probe. + /// The interval, in seconds, for how + /// frequently to probe the endpoint for health status. Typically, the + /// interval is slightly less than half the allocated timeout period + /// (in seconds) which allows two full probes before taking the + /// instance out of rotation. The default value is 15, the minimum + /// value is 5. + /// The number of probes where if no + /// response, will result in stopping further traffic from being + /// delivered to the endpoint. This values allows endpoints to be taken + /// out of rotation faster or slower than the typical times used in + /// Azure. + /// The URI used for requesting health status + /// from the VM. Path is required if a protocol is set to http. + /// Otherwise, it is not allowed. There is no default value. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// Gets name of the resource that is unique within + /// a resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public Probe(string protocol, int port, string id = default(string), IList loadBalancingRules = default(IList), int? intervalInSeconds = default(int?), int? numberOfProbes = default(int?), string requestPath = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -45,15 +79,15 @@ public Probe() { } } /// - /// Gets Load balancer rules that use this probe + /// Gets the load balancer rules that use this probe. /// [JsonProperty(PropertyName = "properties.loadBalancingRules")] - public IList LoadBalancingRules { get; private set; } + public IList LoadBalancingRules { get; protected set; } /// - /// Gets or sets the protocol of the end point. Possible values are - /// http or Tcp. If Tcp is specified, a received ACK is required for - /// the probe to be successful. If http is specified,a 200 OK + /// Gets or sets the protocol of the end point. Possible values are: + /// 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + /// for the probe to be successful. If 'Http' is specified, a 200 OK /// response from the specifies URI is required for the probe to be /// successful. Possible values include: 'Http', 'Tcp' /// @@ -61,7 +95,7 @@ public Probe() { } public string Protocol { get; set; } /// - /// Gets or sets Port for communicating the probe. Possible values + /// Gets or sets the port for communicating the probe. Possible values /// range from 1 to 65535, inclusive. /// [JsonProperty(PropertyName = "properties.port")] @@ -69,55 +103,58 @@ public Probe() { } /// /// Gets or sets the interval, in seconds, for how frequently to probe - /// the endpoint for health status. Typically, the interval is - /// slightly less than half the allocated timeout period (in seconds) - /// which allows two full probes before taking the instance out of - /// rotation. The default value is 15, the minimum value is 5 + /// the endpoint for health status. Typically, the interval is slightly + /// less than half the allocated timeout period (in seconds) which + /// allows two full probes before taking the instance out of rotation. + /// The default value is 15, the minimum value is 5. /// [JsonProperty(PropertyName = "properties.intervalInSeconds")] public int? IntervalInSeconds { get; set; } /// - /// Gets or sets the number of probes where if no response, will - /// result in stopping further traffic from being delivered to the - /// endpoint. This values allows endpoints to be taken out of - /// rotation faster or slower than the typical times used in Azure. + /// Gets or sets the number of probes where if no response, will result + /// in stopping further traffic from being delivered to the endpoint. + /// This values allows endpoints to be taken out of rotation faster or + /// slower than the typical times used in Azure. /// [JsonProperty(PropertyName = "properties.numberOfProbes")] public int? NumberOfProbes { get; set; } /// - /// Gets or sets the URI used for requesting health status from the - /// VM. Path is required if a protocol is set to http. Otherwise, it - /// is not allowed. There is no default value + /// Gets or sets the URI used for requesting health status from the VM. + /// Path is required if a protocol is set to http. Otherwise, it is not + /// allowed. There is no default value. /// [JsonProperty(PropertyName = "properties.requestPath")] public string RequestPath { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) @@ -127,3 +164,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs index cdb2533714b3b..43bac48b01273 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProbeProtocol.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ProbeProtocol. @@ -21,3 +21,4 @@ public static class ProbeProtocol public const string Tcp = "Tcp"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs index ca0e05006e7db..891cac826ab0c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ProcessorArchitecture.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ProcessorArchitecture. @@ -21,3 +21,4 @@ public static class ProcessorArchitecture public const string X86 = "X86"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs index 3f26c882394c5..a170c074263a6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddress.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// PublicIPAddress resource + /// Public IP address resource. /// [JsonTransformation] public partial class PublicIPAddress : Resource @@ -30,6 +32,28 @@ public PublicIPAddress() { } /// /// Initializes a new instance of the PublicIPAddress class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The public IP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The public IP address version. + /// Possible values are: 'IPv4' and 'IPv6'. Possible values include: + /// 'IPv4', 'IPv6' + /// The FQDN of the DNS record associated + /// with the public IP address. + /// The idle timeout of the public + /// IP address. + /// The resource GUID property of the public + /// IP resource. + /// The provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// A unique read-only string that changes whenever + /// the resource is updated. public PublicIPAddress(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string publicIPAllocationMethod = default(string), string publicIPAddressVersion = default(string), IPConfiguration ipConfiguration = default(IPConfiguration), PublicIPAddressDnsSettings dnsSettings = default(PublicIPAddressDnsSettings), string ipAddress = default(string), int? idleTimeoutInMinutes = default(int?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -45,15 +69,16 @@ public PublicIPAddress() { } } /// - /// Gets or sets PublicIP allocation method (Static/Dynamic). Possible - /// values include: 'Static', 'Dynamic' + /// Gets or sets the public IP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// [JsonProperty(PropertyName = "properties.publicIPAllocationMethod")] public string PublicIPAllocationMethod { get; set; } /// - /// Gets or sets PublicIP address version (IPv4/IPv6). Possible values - /// include: 'IPv4', 'IPv6' + /// Gets or sets the public IP address version. Possible values are: + /// 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' /// [JsonProperty(PropertyName = "properties.publicIPAddressVersion")] public string PublicIPAddressVersion { get; set; } @@ -61,11 +86,11 @@ public PublicIPAddress() { } /// /// [JsonProperty(PropertyName = "properties.ipConfiguration")] - public IPConfiguration IpConfiguration { get; private set; } + public IPConfiguration IpConfiguration { get; protected set; } /// - /// Gets or sets FQDN of the DNS record associated with the public IP - /// address + /// Gets or sets the FQDN of the DNS record associated with the public + /// IP address. /// [JsonProperty(PropertyName = "properties.dnsSettings")] public PublicIPAddressDnsSettings DnsSettings { get; set; } @@ -76,30 +101,31 @@ public PublicIPAddress() { } public string IpAddress { get; set; } /// - /// Gets or sets the Idletimeout of the public IP address + /// Gets or sets the idle timeout of the public IP address. /// [JsonProperty(PropertyName = "properties.idleTimeoutInMinutes")] public int? IdleTimeoutInMinutes { get; set; } /// - /// Gets or sets resource guid property of the PublicIP resource + /// Gets or sets the resource GUID property of the public IP resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the PublicIP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs index f46076fbde5dc..70ae86bb7acb9 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/PublicIpAddressDnsSettings.cs @@ -1,23 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Contains FQDN of the DNS record associated with the public IP address + /// Contains the FQDN of the DNS record associated with the public IP + /// address. /// public partial class PublicIPAddressDnsSettings { @@ -29,6 +28,20 @@ public PublicIPAddressDnsSettings() { } /// /// Initializes a new instance of the PublicIPAddressDnsSettings class. /// + /// The domain name label. The + /// concatenation of the domain name label and the regionalized DNS + /// zone make up the fully qualified domain name associated with the + /// public IP address. If a domain name label is specified, an A DNS + /// record is created for the public IP in the Microsoft Azure DNS + /// system. + /// The FQDN (fully qualified domain name) of the A + /// DNS record associated with the public IP. This is the concatenation + /// of the domainNameLabel and the regionalized DNS zone. + /// The reverse FQDN. A user-visible, fully + /// qualified domain name that resolves to this public IP address. If + /// the reverseFqdn is specified, then a PTR DNS record is created + /// pointing from the IP address in the in-addr.arpa domain to the + /// reverse FQDN. public PublicIPAddressDnsSettings(string domainNameLabel = default(string), string fqdn = default(string), string reverseFqdn = default(string)) { DomainNameLabel = domainNameLabel; @@ -37,32 +50,32 @@ public PublicIPAddressDnsSettings() { } } /// - /// Gets or sets the Domain name label.The concatenation of the domain + /// Gets or sets the domain name label. The concatenation of the domain /// name label and the regionalized DNS zone make up the fully /// qualified domain name associated with the public IP address. If a - /// domain name label is specified, an A DNS record is created for - /// the public IP in the Microsoft Azure DNS system. + /// domain name label is specified, an A DNS record is created for the + /// public IP in the Microsoft Azure DNS system. /// [JsonProperty(PropertyName = "domainNameLabel")] public string DomainNameLabel { get; set; } /// - /// Gets the FQDN, Fully qualified domain name of the A DNS record - /// associated with the public IP. This is the concatenation of the - /// domainNameLabel and the regionalized DNS zone. + /// Gets or sets the FQDN (fully qualified domain name) of the A DNS + /// record associated with the public IP. This is the concatenation of + /// the domainNameLabel and the regionalized DNS zone. /// [JsonProperty(PropertyName = "fqdn")] public string Fqdn { get; set; } /// - /// Gets or Sets the Reverse FQDN. A user-visible, fully qualified + /// Gets or sets the reverse FQDN. A user-visible, fully qualified /// domain name that resolves to this public IP address. If the - /// reverseFqdn is specified, then a PTR DNS record is created - /// pointing from the IP address in the in-addr.arpa domain to the - /// reverse FQDN. + /// reverseFqdn is specified, then a PTR DNS record is created pointing + /// from the IP address in the in-addr.arpa domain to the reverse FQDN. /// [JsonProperty(PropertyName = "reverseFqdn")] public string ReverseFqdn { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs index ad306ce94e3ee..ee22be48703db 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Resource.cs @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Azure; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; public partial class Resource : IResource { @@ -26,6 +28,11 @@ public Resource() { } /// /// Initializes a new instance of the Resource class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { Id = id; @@ -36,34 +43,35 @@ public Resource() { } } /// - /// Resource Id + /// Gets or sets resource ID. /// [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// - /// Resource name + /// Gets resource name. /// [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + public string Name { get; protected set; } /// - /// Resource type + /// Gets resource type. /// [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + public string Type { get; protected set; } /// - /// Resource location + /// Gets or sets resource location. /// [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// - /// Resource tags + /// Gets or sets resource tags. /// [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs index 04c2be0fd584e..03420b4b17b44 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ResourceNavigationLink.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// ResourceNavigationLink resource + /// ResourceNavigationLink resource. /// [JsonTransformation] public partial class ResourceNavigationLink : SubResource @@ -30,6 +30,17 @@ public ResourceNavigationLink() { } /// /// Initializes a new instance of the ResourceNavigationLink class. /// + /// Resource ID. + /// Resource type of the linked + /// resource. + /// Link to the external resource + /// Provisioning state of the + /// ResourceNavigationLink resource. + /// Name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public ResourceNavigationLink(string id = default(string), string linkedResourceType = default(string), string link = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -41,36 +52,37 @@ public ResourceNavigationLink() { } } /// - /// Resource type of the linked resource + /// Gets or sets resource type of the linked resource. /// [JsonProperty(PropertyName = "properties.linkedResourceType")] public string LinkedResourceType { get; set; } /// - /// Link to the external resource + /// Gets or sets link to the external resource /// [JsonProperty(PropertyName = "properties.link")] public string Link { get; set; } /// - /// Provisioning state of the ResourceNavigationLink resource + /// Gets provisioning state of the ResourceNavigationLink resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// - /// Name of the resource that is unique within a resource group. This - /// name can be used to access the resource + /// Gets or sets name of the resource that is unique within a resource + /// group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets a unique read-only string that changes whenever the resource + /// is updated. /// [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + public string Etag { get; protected set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs index b368415fc4b2a..163ddade41faf 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Route.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// Route resource @@ -30,6 +30,25 @@ public Route() { } /// /// Initializes a new instance of the Route class. /// + /// The type of Azure hop the packet should + /// be sent to. Possible values are: 'VirtualNetworkGateway', + /// 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible + /// values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' + /// Resource ID. + /// The destination CIDR to which the route + /// applies. + /// The IP address packets should be + /// forwarded to. Next hop values are only allowed in routes where the + /// next hop type is VirtualAppliance. + /// The provisioning state of the + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public Route(string nextHopType, string id = default(string), string addressPrefix = default(string), string nextHopIpAddress = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -49,8 +68,10 @@ public Route() { } /// /// Gets or sets the type of Azure hop the packet should be sent to. - /// Possible values include: 'VirtualNetworkGateway', 'VnetLocal', - /// 'Internet', 'VirtualAppliance', 'None' + /// Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + /// 'Internet', 'VirtualAppliance', and 'None'. Possible values + /// include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + /// 'VirtualAppliance', 'None' /// [JsonProperty(PropertyName = "properties.nextHopType")] public string NextHopType { get; set; } @@ -64,28 +85,32 @@ public Route() { } public string NextHopIpAddress { get; set; } /// - /// Gets provisioning state of the resource Updating/Deleting/Failed + /// Gets or sets the provisioning state of the resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (NextHopType == null) @@ -95,3 +120,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs index 72b9e5fa8e9eb..28fed7dbe569e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteNextHopType.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for RouteNextHopType. @@ -24,3 +24,4 @@ public static class RouteNextHopType public const string None = "None"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs index a5ff1aa40c586..9a2241c0fda66 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/RouteTable.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// RouteTable resource + /// Route table resource. /// [JsonTransformation] public partial class RouteTable : Resource @@ -30,6 +32,20 @@ public RouteTable() { } /// /// Initializes a new instance of the RouteTable class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Collection of routes contained within a route + /// table. + /// A collection of references to + /// subnets. + /// The provisioning state of the + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. public RouteTable(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IList routes = default(IList), IList subnets = default(IList), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -40,29 +56,31 @@ public RouteTable() { } } /// - /// Gets or sets Routes in a Route Table + /// Gets or sets collection of routes contained within a route table. /// [JsonProperty(PropertyName = "properties.routes")] public IList Routes { get; set; } /// - /// Gets collection of references to subnets + /// Gets a collection of references to subnets. /// [JsonProperty(PropertyName = "properties.subnets")] - public IList Subnets { get; private set; } + public IList Subnets { get; protected set; } /// - /// Gets provisioning state of the resource Updating/Deleting/Failed + /// Gets or sets the provisioning state of the resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs index 86fa244418001..ccdbc104c7265 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRule.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Network security rule + /// Network security rule. /// [JsonTransformation] public partial class SecurityRule : SubResource @@ -30,6 +30,46 @@ public SecurityRule() { } /// /// Initializes a new instance of the SecurityRule class. /// + /// Network protocol this rule applies to. + /// Possible values are 'Tcp', 'Udp', and '*'. Possible values include: + /// 'Tcp', 'Udp', '*' + /// The CIDR or source IP range. + /// Asterix '*' can also be used to match all source IPs. Default tags + /// such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can + /// also be used. If this is an ingress rule, specifies where network + /// traffic originates from. + /// The destination address + /// prefix. CIDR or source IP range. Asterix '*' can also be used to + /// match all source IPs. Default tags such as 'VirtualNetwork', + /// 'AzureLoadBalancer' and 'Internet' can also be used. + /// The network traffic is allowed or denied. + /// Possible values are: 'Allow' and 'Deny'. Possible values include: + /// 'Allow', 'Deny' + /// The direction of the rule. The direction + /// specifies if rule will be evaluated on incoming or outcoming + /// traffic. Possible values are: 'Inbound' and 'Outbound'. Possible + /// values include: 'Inbound', 'Outbound' + /// Resource ID. + /// A description for this rule. Restricted + /// to 140 chars. + /// The source port or range. Integer or + /// range between 0 and 65535. Asterix '*' can also be used to match + /// all ports. + /// The destination port or range. + /// Integer or range between 0 and 65535. Asterix '*' can also be used + /// to match all ports. + /// The priority of the rule. The value can be + /// between 100 and 4096. The priority number must be unique for each + /// rule in the collection. The lower the priority number, the higher + /// the priority of the rule. + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public SecurityRule(string protocol, string sourceAddressPrefix, string destinationAddressPrefix, string access, string direction, string id = default(string), string description = default(string), string sourcePortRange = default(string), string destinationPortRange = default(string), int? priority = default(int?), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -54,93 +94,100 @@ public SecurityRule() { } public string Description { get; set; } /// - /// Gets or sets Network protocol this rule applies to. Can be Tcp, - /// Udp or All(*). Possible values include: 'Tcp', 'Udp', '*' + /// Gets or sets network protocol this rule applies to. Possible values + /// are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + /// '*' /// [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } /// - /// Gets or sets Source Port or Range. Integer or range between 0 and - /// 65535. Asterix '*' can also be used to match all ports. + /// Gets or sets the source port or range. Integer or range between 0 + /// and 65535. Asterix '*' can also be used to match all ports. /// [JsonProperty(PropertyName = "properties.sourcePortRange")] public string SourcePortRange { get; set; } /// - /// Gets or sets Destination Port or Range. Integer or range between 0 - /// and 65535. Asterix '*' can also be used to match all ports. + /// Gets or sets the destination port or range. Integer or range + /// between 0 and 65535. Asterix '*' can also be used to match all + /// ports. /// [JsonProperty(PropertyName = "properties.destinationPortRange")] public string DestinationPortRange { get; set; } /// - /// Gets or sets source address prefix. CIDR or source IP range. - /// Asterix '*' can also be used to match all source IPs. Default - /// tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - /// can also be used. If this is an ingress rule, specifies where - /// network traffic originates from. + /// Gets or sets the CIDR or source IP range. Asterix '*' can also be + /// used to match all source IPs. Default tags such as + /// 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be + /// used. If this is an ingress rule, specifies where network traffic + /// originates from. /// [JsonProperty(PropertyName = "properties.sourceAddressPrefix")] public string SourceAddressPrefix { get; set; } /// - /// Gets or sets destination address prefix. CIDR or source IP range. - /// Asterix '*' can also be used to match all source IPs. Default - /// tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - /// can also be used. + /// Gets or sets the destination address prefix. CIDR or source IP + /// range. Asterix '*' can also be used to match all source IPs. + /// Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + /// 'Internet' can also be used. /// [JsonProperty(PropertyName = "properties.destinationAddressPrefix")] public string DestinationAddressPrefix { get; set; } /// - /// Gets or sets network traffic is allowed or denied. Possible values - /// are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + /// Gets or sets the network traffic is allowed or denied. Possible + /// values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + /// 'Deny' /// [JsonProperty(PropertyName = "properties.access")] public string Access { get; set; } /// - /// Gets or sets the priority of the rule. The value can be between - /// 100 and 4096. The priority number must be unique for each rule in - /// the collection. The lower the priority number, the higher the - /// priority of the rule. + /// Gets or sets the priority of the rule. The value can be between 100 + /// and 4096. The priority number must be unique for each rule in the + /// collection. The lower the priority number, the higher the priority + /// of the rule. /// [JsonProperty(PropertyName = "properties.priority")] public int? Priority { get; set; } /// - /// Gets or sets the direction of the rule.InBound or Outbound. The - /// direction specifies if rule will be evaluated on incoming or - /// outcoming traffic. Possible values include: 'Inbound', 'Outbound' + /// Gets or sets the direction of the rule. The direction specifies if + /// rule will be evaluated on incoming or outcoming traffic. Possible + /// values are: 'Inbound' and 'Outbound'. Possible values include: + /// 'Inbound', 'Outbound' /// [JsonProperty(PropertyName = "properties.direction")] public string Direction { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the public IP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Protocol == null) @@ -166,3 +213,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs index 81e609d48e8a2..7cd9ce222f29f 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleAccess.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for SecurityRuleAccess. @@ -21,3 +21,4 @@ public static class SecurityRuleAccess public const string Deny = "Deny"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs index fe0144f41b00d..2ea2c10c51882 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleDirection.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for SecurityRuleDirection. @@ -21,3 +21,4 @@ public static class SecurityRuleDirection public const string Outbound = "Outbound"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs index 4aba5be7522fc..a9c32920efae0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SecurityRuleProtocol.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for SecurityRuleProtocol. @@ -22,3 +22,4 @@ public static class SecurityRuleProtocol public const string Asterisk = "*"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs index 68f3624374d7e..e371f76d320e6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/ServiceProviderProvisioningState.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for ServiceProviderProvisioningState. @@ -23,3 +23,4 @@ public static class ServiceProviderProvisioningState public const string Deprovisioning = "Deprovisioning"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs index 04b4d4959c471..6ee08a2a74609 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/SubResource.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Azure; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; public partial class SubResource : IResource { @@ -26,16 +26,18 @@ public SubResource() { } /// /// Initializes a new instance of the SubResource class. /// + /// Resource ID. public SubResource(string id = default(string)) { Id = id; } /// - /// Resource Id + /// Gets or sets resource ID. /// [JsonProperty(PropertyName = "id")] public string Id { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs index ddd40a6e277a2..144b12acd9866 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Subnet.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Subnet in a VirtualNework resource + /// Subnet in a virtual network resource. /// [JsonTransformation] public partial class Subnet : SubResource @@ -30,6 +32,24 @@ public Subnet() { } /// /// Initializes a new instance of the Subnet class. /// + /// Resource ID. + /// The address prefix for the + /// subnet. + /// The reference of the + /// NetworkSecurityGroup resource. + /// The reference of the RouteTable + /// resource. + /// Gets an array of references to the + /// network interface IP configurations using subnet. + /// Gets an array of references + /// to the external resources using subnet. + /// The provisioning state of the + /// resource. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,55 +64,56 @@ public Subnet() { } } /// - /// Gets or sets Address prefix for the subnet. + /// Gets or sets the address prefix for the subnet. /// [JsonProperty(PropertyName = "properties.addressPrefix")] public string AddressPrefix { get; set; } /// - /// Gets or sets the reference of the NetworkSecurityGroup resource + /// Gets or sets the reference of the NetworkSecurityGroup resource. /// [JsonProperty(PropertyName = "properties.networkSecurityGroup")] public NetworkSecurityGroup NetworkSecurityGroup { get; set; } /// - /// Gets or sets the reference of the RouteTable resource + /// Gets or sets the reference of the RouteTable resource. /// [JsonProperty(PropertyName = "properties.routeTable")] public RouteTable RouteTable { get; set; } /// - /// Gets array of references to the network interface IP - /// configurations using subnet + /// Gets an array of references to the network interface IP + /// configurations using subnet. /// [JsonProperty(PropertyName = "properties.ipConfigurations")] - public IList IpConfigurations { get; private set; } + public IList IpConfigurations { get; protected set; } /// - /// Gets array of references to the external resources using subnet + /// Gets an array of references to the external resources using subnet. /// [JsonProperty(PropertyName = "properties.resourceNavigationLinks")] public IList ResourceNavigationLinks { get; set; } /// - /// Gets provisioning state of the resource + /// Gets or sets the provisioning state of the resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs index f6ab2f77b1f3c..8635ba7c89f88 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TransportProtocol.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for TransportProtocol. @@ -21,3 +21,4 @@ public static class TransportProtocol public const string Tcp = "Tcp"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs index c17f5e2003eb9..b5f12b12006ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/TunnelConnectionHealth.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// VirtualNetworkGatewayConnection properties @@ -29,6 +27,16 @@ public TunnelConnectionHealth() { } /// /// Initializes a new instance of the TunnelConnectionHealth class. /// + /// Tunnel name. + /// Virtual network Gateway connection + /// status. Possible values include: 'Unknown', 'Connecting', + /// 'Connected', 'NotConnected' + /// The Ingress Bytes Transferred + /// in this connection + /// The Egress Bytes Transferred + /// in this connection + /// The time at which + /// connection was established in Utc format. public TunnelConnectionHealth(string tunnel = default(string), string connectionStatus = default(string), long? ingressBytesTransferred = default(long?), long? egressBytesTransferred = default(long?), string lastConnectionEstablishedUtcTime = default(string)) { Tunnel = tunnel; @@ -39,35 +47,36 @@ public TunnelConnectionHealth() { } } /// - /// Tunnel name. + /// Gets tunnel name. /// [JsonProperty(PropertyName = "tunnel")] - public string Tunnel { get; private set; } + public string Tunnel { get; protected set; } /// - /// Virtual network Gateway connection status. Possible values + /// Gets virtual network Gateway connection status. Possible values /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' /// [JsonProperty(PropertyName = "connectionStatus")] - public string ConnectionStatus { get; private set; } + public string ConnectionStatus { get; protected set; } /// - /// The Ingress Bytes Transferred in this connection + /// Gets the Ingress Bytes Transferred in this connection /// [JsonProperty(PropertyName = "ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + public long? IngressBytesTransferred { get; protected set; } /// - /// The Egress Bytes Transferred in this connection + /// Gets the Egress Bytes Transferred in this connection /// [JsonProperty(PropertyName = "egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + public long? EgressBytesTransferred { get; protected set; } /// - /// The time at which connection was established in Utc format. + /// Gets the time at which connection was established in Utc format. /// [JsonProperty(PropertyName = "lastConnectionEstablishedUtcTime")] - public string LastConnectionEstablishedUtcTime { get; private set; } + public string LastConnectionEstablishedUtcTime { get; protected set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs index 6d5030d15ae7f..53195b718c2b0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/Usage.cs @@ -1,23 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Describes Network Resource Usage. + /// Describes network resource usage. /// public partial class Usage { @@ -29,6 +28,9 @@ public Usage() { } /// /// Initializes a new instance of the Usage class. /// + /// The current value of the usage. + /// The limit of usage. + /// The name of the type of usage. public Usage(long currentValue, long limit, UsageName name) { CurrentValue = currentValue; @@ -62,14 +64,17 @@ static Usage() public UsageName Name { get; set; } /// - /// Gets or sets an enum describing the unit of measurement. + /// An enum describing the unit of measurement. /// [JsonProperty(PropertyName = "unit")] public static string Unit { get; private set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Name == null) @@ -79,3 +84,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs index d99361b65326b..f5d33240e0ff7 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/UsageName.cs @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// The Usage Names. + /// The usage names. /// public partial class UsageName { @@ -29,6 +27,9 @@ public UsageName() { } /// /// Initializes a new instance of the UsageName class. /// + /// A string describing the resource name. + /// A localized string describing the + /// resource name. public UsageName(string value = default(string), string localizedValue = default(string)) { Value = value; @@ -49,3 +50,4 @@ public UsageName() { } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs index d6f4d3dfa2840..ee350e126ab52 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetwork.cs @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// Virtual Network resource + /// Virtual Network resource. /// [JsonTransformation] public partial class VirtualNetwork : Resource @@ -30,6 +32,27 @@ public VirtualNetwork() { } /// /// Initializes a new instance of the VirtualNetwork class. /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The AddressSpace that contains an array + /// of IP address ranges that can be used by subnets. + /// The dhcpOptions that contains an array of + /// DNS servers available to VMs deployed in the virtual + /// network. + /// A list of subnets in a Virtual + /// Network. + /// A list of peerings in a + /// Virtual Network. + /// The resourceGuid property of the Virtual + /// Network resource. + /// The provisioning state of the + /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. public VirtualNetwork(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), AddressSpace addressSpace = default(AddressSpace), DhcpOptions dhcpOptions = default(DhcpOptions), IList subnets = default(IList), IList virtualNetworkPeerings = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -43,50 +66,52 @@ public VirtualNetwork() { } } /// - /// Gets or sets AddressSpace that contains an array of IP address - /// ranges that can be used by subnets + /// Gets or sets the AddressSpace that contains an array of IP address + /// ranges that can be used by subnets. /// [JsonProperty(PropertyName = "properties.addressSpace")] public AddressSpace AddressSpace { get; set; } /// - /// Gets or sets DHCPOptions that contains an array of DNS servers - /// available to VMs deployed in the virtual network + /// Gets or sets the dhcpOptions that contains an array of DNS servers + /// available to VMs deployed in the virtual network. /// [JsonProperty(PropertyName = "properties.dhcpOptions")] public DhcpOptions DhcpOptions { get; set; } /// - /// Gets or sets list of subnets in a VirtualNetwork + /// Gets or sets a list of subnets in a Virtual Network. /// [JsonProperty(PropertyName = "properties.subnets")] public IList Subnets { get; set; } /// - /// Gets or sets list of peerings in a VirtualNetwork + /// Gets or sets a list of peerings in a Virtual Network. /// - [JsonProperty(PropertyName = "properties.VirtualNetworkPeerings")] + [JsonProperty(PropertyName = "properties.virtualNetworkPeerings")] public IList VirtualNetworkPeerings { get; set; } /// - /// Gets or sets resource guid property of the VirtualNetwork resource + /// Gets or sets the resourceGuid property of the Virtual Network + /// resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets or sets the provisioning state of the PublicIP resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs index 3fce3791d7c46..ec6849f3713ac 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGateway.cs @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// A common class for general resource information @@ -30,6 +32,41 @@ public VirtualNetworkGateway() { } /// /// Initializes a new instance of the VirtualNetworkGateway class. /// + /// IP configurations for virtual + /// network gateway. + /// The type of this virtual network gateway. + /// Possible values are: 'Vpn' and 'ExpressRoute'. Possible values + /// include: 'Vpn', 'ExpressRoute' + /// The type of this virtual network gateway. + /// Possible values are: 'PolicyBased' and 'RouteBased'. Possible + /// values include: 'PolicyBased', 'RouteBased' + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// Whether BGP is enabled for this virtual + /// network gateway or not. + /// ActiveActive flag + /// The reference of the + /// LocalNetworkGateway resource which represents local network site + /// having default routes. Assign Null value in case of removing + /// existing default site setting. + /// The reference of the VirtualNetworkGatewaySku + /// resource which represents the SKU selected for Virtual network + /// gateway. + /// The reference of the + /// VpnClientConfiguration resource which represents the P2S VpnClient + /// configurations. + /// Virtual network gateway's BGP speaker + /// settings. + /// The resource GUID property of the + /// VirtualNetworkGateway resource. + /// The provisioning state of the + /// VirtualNetworkGateway resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. public VirtualNetworkGateway(IList ipConfigurations, string gatewayType, string vpnType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), bool? enableBgp = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), BgpSettings bgpSettings = default(BgpSettings), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -48,49 +85,51 @@ public VirtualNetworkGateway() { } } /// - /// IpConfigurations for Virtual network gateway. + /// Gets or sets IP configurations for virtual network gateway. /// [JsonProperty(PropertyName = "properties.ipConfigurations")] public IList IpConfigurations { get; set; } /// - /// The type of this virtual network gateway. Possible values include: + /// Gets or sets the type of this virtual network gateway. Possible + /// values are: 'Vpn' and 'ExpressRoute'. Possible values include: /// 'Vpn', 'ExpressRoute' /// [JsonProperty(PropertyName = "properties.gatewayType")] public string GatewayType { get; set; } /// - /// The type of this virtual network gateway. Possible values include: - /// 'PolicyBased', 'RouteBased' + /// Gets or sets the type of this virtual network gateway. Possible + /// values are: 'PolicyBased' and 'RouteBased'. Possible values + /// include: 'PolicyBased', 'RouteBased' /// [JsonProperty(PropertyName = "properties.vpnType")] public string VpnType { get; set; } /// - /// EnableBgp Flag + /// Gets or sets whether BGP is enabled for this virtual network + /// gateway or not. /// [JsonProperty(PropertyName = "properties.enableBgp")] public bool? EnableBgp { get; set; } /// - /// ActiveActive flag + /// Gets or sets activeActive flag /// [JsonProperty(PropertyName = "properties.activeActive")] public bool? ActiveActive { get; set; } /// /// Gets or sets the reference of the LocalNetworkGateway resource - /// which represents Local network site having default routes. Assign + /// which represents local network site having default routes. Assign /// Null value in case of removing existing default site setting. /// [JsonProperty(PropertyName = "properties.gatewayDefaultSite")] public SubResource GatewayDefaultSite { get; set; } /// - /// Gets or sets the reference of the VirtualNetworkGatewaySku - /// resource which represents the sku selected for Virtual network - /// gateway. + /// Gets or sets the reference of the VirtualNetworkGatewaySku resource + /// which represents the SKU selected for Virtual network gateway. /// [JsonProperty(PropertyName = "properties.sku")] public VirtualNetworkGatewaySku Sku { get; set; } @@ -103,35 +142,38 @@ public VirtualNetworkGateway() { } public VpnClientConfiguration VpnClientConfiguration { get; set; } /// - /// Virtual network gateway's BGP speaker settings + /// Gets or sets virtual network gateway's BGP speaker settings. /// [JsonProperty(PropertyName = "properties.bgpSettings")] public BgpSettings BgpSettings { get; set; } /// - /// Gets or sets resource guid property of the VirtualNetworkGateway - /// resource + /// Gets or sets the resource GUID property of the + /// VirtualNetworkGateway resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the VirtualNetworkGateway resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the VirtualNetworkGateway resource. + /// Possible values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (IpConfigurations == null) @@ -146,9 +188,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "VpnType"); } - if (this.IpConfigurations != null) + if (IpConfigurations != null) { - foreach (var element in this.IpConfigurations) + foreach (var element in IpConfigurations) { if (element != null) { @@ -156,10 +198,11 @@ public virtual void Validate() } } } - if (this.Sku != null) + if (Sku != null) { - this.Sku.Validate(); + Sku.Validate(); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs index 0e0fb05490bbd..bc1fc82be665c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -1,20 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// /// A common class for general resource information @@ -32,6 +34,37 @@ public VirtualNetworkGatewayConnection() { } /// Initializes a new instance of the VirtualNetworkGatewayConnection /// class. /// + /// Gateway connection type. Possible + /// values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. + /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', + /// 'VPNClient' + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The authorizationKey. + /// The routing weight. + /// The IPSec shared key. + /// Virtual network Gateway connection + /// status. Possible values are 'Unknown', 'Connecting', 'Connected' + /// and 'NotConnected'. Possible values include: 'Unknown', + /// 'Connecting', 'Connected', 'NotConnected' + /// Collection of all tunnels' + /// connection health status. + /// The egress bytes transferred + /// in this connection. + /// The ingress bytes transferred + /// in this connection. + /// The reference to peerings resource. + /// EnableBgp flag + /// The resource GUID property of the + /// VirtualNetworkGatewayConnection resource. + /// The provisioning state of the + /// VirtualNetworkGatewayConnection resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, string connectionType, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string authorizationKey = default(string), VirtualNetworkGateway virtualNetworkGateway2 = default(VirtualNetworkGateway), LocalNetworkGateway localNetworkGateway2 = default(LocalNetworkGateway), int? routingWeight = default(int?), string sharedKey = default(string), string connectionStatus = default(string), IList tunnelConnectionStatus = default(IList), long? egressBytesTransferred = default(long?), long? ingressBytesTransferred = default(long?), SubResource peer = default(SubResource), bool? enableBgp = default(bool?), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { @@ -54,7 +87,7 @@ public VirtualNetworkGatewayConnection() { } } /// - /// The authorizationKey. + /// Gets or sets the authorizationKey. /// [JsonProperty(PropertyName = "properties.authorizationKey")] public string AuthorizationKey { get; set; } @@ -75,86 +108,92 @@ public VirtualNetworkGatewayConnection() { } public LocalNetworkGateway LocalNetworkGateway2 { get; set; } /// - /// Gateway connection type -Ipsec/Dedicated/VpnClient/Vnet2Vnet. - /// Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', - /// 'VPNClient' + /// Gets or sets gateway connection type. Possible values are: + /// 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + /// include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' /// [JsonProperty(PropertyName = "properties.connectionType")] public string ConnectionType { get; set; } /// - /// The Routing weight. + /// Gets or sets the routing weight. /// [JsonProperty(PropertyName = "properties.routingWeight")] public int? RoutingWeight { get; set; } /// - /// The Ipsec share key. + /// Gets or sets the IPSec shared key. /// [JsonProperty(PropertyName = "properties.sharedKey")] public string SharedKey { get; set; } /// - /// Virtual network Gateway connection status. Possible values - /// include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' + /// Gets virtual network Gateway connection status. Possible values are + /// 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible + /// values include: 'Unknown', 'Connecting', 'Connected', + /// 'NotConnected' /// [JsonProperty(PropertyName = "properties.connectionStatus")] - public string ConnectionStatus { get; private set; } + public string ConnectionStatus { get; protected set; } /// - /// Collection of all tunnels' connection health status. + /// Gets collection of all tunnels' connection health status. /// [JsonProperty(PropertyName = "properties.tunnelConnectionStatus")] - public IList TunnelConnectionStatus { get; private set; } + public IList TunnelConnectionStatus { get; protected set; } /// - /// The Egress Bytes Transferred in this connection + /// Gets the egress bytes transferred in this connection. /// [JsonProperty(PropertyName = "properties.egressBytesTransferred")] - public long? EgressBytesTransferred { get; private set; } + public long? EgressBytesTransferred { get; protected set; } /// - /// The Ingress Bytes Transferred in this connection + /// Gets the ingress bytes transferred in this connection. /// [JsonProperty(PropertyName = "properties.ingressBytesTransferred")] - public long? IngressBytesTransferred { get; private set; } + public long? IngressBytesTransferred { get; protected set; } /// - /// The reference to peerings resource. + /// Gets or sets the reference to peerings resource. /// [JsonProperty(PropertyName = "properties.peer")] public SubResource Peer { get; set; } /// - /// EnableBgp Flag + /// Gets or sets enableBgp flag /// [JsonProperty(PropertyName = "properties.enableBgp")] public bool? EnableBgp { get; set; } /// - /// Gets or sets resource guid property of the - /// VirtualNetworkGatewayConnection resource + /// Gets or sets the resource GUID property of the + /// VirtualNetworkGatewayConnection resource. /// [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; set; } /// - /// Gets provisioning state of the VirtualNetworkGatewayConnection - /// resource Updating/Deleting/Failed + /// Gets the provisioning state of the VirtualNetworkGatewayConnection + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// /// Gets a unique read-only string that changes whenever the resource - /// is updated + /// is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (VirtualNetworkGateway1 == null) @@ -165,18 +204,19 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType"); } - if (this.VirtualNetworkGateway1 != null) + if (VirtualNetworkGateway1 != null) { - this.VirtualNetworkGateway1.Validate(); + VirtualNetworkGateway1.Validate(); } - if (this.VirtualNetworkGateway2 != null) + if (VirtualNetworkGateway2 != null) { - this.VirtualNetworkGateway2.Validate(); + VirtualNetworkGateway2.Validate(); } - if (this.LocalNetworkGateway2 != null) + if (LocalNetworkGateway2 != null) { - this.LocalNetworkGateway2.Validate(); + LocalNetworkGateway2.Validate(); } } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs index 2246e29e89999..12de02e6b839e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionStatus.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewayConnectionStatus. @@ -23,3 +23,4 @@ public static class VirtualNetworkGatewayConnectionStatus public const string NotConnected = "NotConnected"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs index bda99c43aa06f..b9b195c21d7d5 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayConnectionType.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewayConnectionType. @@ -23,3 +23,4 @@ public static class VirtualNetworkGatewayConnectionType public const string VPNClient = "VPNClient"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs index a9f507a946af1..2a2154d0a8372 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// IpConfiguration for Virtual network gateway + /// IP configuration for virtual network gateway /// [JsonTransformation] public partial class VirtualNetworkGatewayIPConfiguration : SubResource @@ -32,6 +32,21 @@ public VirtualNetworkGatewayIPConfiguration() { } /// Initializes a new instance of the /// VirtualNetworkGatewayIPConfiguration class. /// + /// The reference of the subnet resource. + /// The reference of the public IP + /// resource. + /// Resource ID. + /// The private IP allocation + /// method. Possible values are: 'Static' and 'Dynamic'. Possible + /// values include: 'Static', 'Dynamic' + /// The provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VirtualNetworkGatewayIPConfiguration(SubResource subnet, SubResource publicIPAddress, string id = default(string), string privateIPAllocationMethod = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -44,48 +59,52 @@ public VirtualNetworkGatewayIPConfiguration() { } } /// - /// Gets or sets PrivateIP allocation method. Possible values include: - /// 'Static', 'Dynamic' + /// Gets or sets the private IP allocation method. Possible values are: + /// 'Static' and 'Dynamic'. Possible values include: 'Static', + /// 'Dynamic' /// [JsonProperty(PropertyName = "properties.privateIPAllocationMethod")] public string PrivateIPAllocationMethod { get; set; } /// - /// Gets or sets the reference of the subnet resource + /// Gets or sets the reference of the subnet resource. /// [JsonProperty(PropertyName = "properties.subnet")] public SubResource Subnet { get; set; } /// - /// Gets or sets the reference of the PublicIP resource + /// Gets or sets the reference of the public IP resource. /// [JsonProperty(PropertyName = "properties.publicIPAddress")] public SubResource PublicIPAddress { get; set; } /// - /// Gets provisioning state of the PublicIP resource - /// Updating/Deleting/Failed + /// Gets the provisioning state of the public IP resource. Possible + /// values are: 'Updating', 'Deleting', and 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Subnet == null) @@ -99,3 +118,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs index 1afd20d3a89ed..bdf95f3f30818 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySku.cs @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// VirtualNetworkGatewaySku details @@ -29,6 +28,15 @@ public VirtualNetworkGatewaySku() { } /// /// Initializes a new instance of the VirtualNetworkGatewaySku class. /// + /// Gateway SKU name. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', + /// 'UltraPerformance' + /// Gateway SKU tier. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', + /// 'UltraPerformance' + /// The capacity. public VirtualNetworkGatewaySku(string name, string tier, int? capacity = default(int?)) { Name = name; @@ -37,30 +45,35 @@ public VirtualNetworkGatewaySku() { } } /// - /// Gateway sku name -Basic/HighPerformance/Standard/UltraPerformance. - /// Possible values include: 'Basic', 'HighPerformance', 'Standard', + /// Gets or sets gateway SKU name. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', /// 'UltraPerformance' /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gateway sku tier -Basic/HighPerformance/Standard/UltraPerformance. - /// Possible values include: 'Basic', 'HighPerformance', 'Standard', + /// Gets or sets gateway SKU tier. Possible values are: 'Basic', + /// 'HighPerformance','Standard', and 'UltraPerformance'. Possible + /// values include: 'Basic', 'HighPerformance', 'Standard', /// 'UltraPerformance' /// [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// The capacity + /// Gets or sets the capacity. /// [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (Name == null) @@ -74,3 +87,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs index 40d1ffa70db0c..4bfa82f7c3ae1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuName.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewaySkuName. @@ -23,3 +23,4 @@ public static class VirtualNetworkGatewaySkuName public const string UltraPerformance = "UltraPerformance"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs index e08411afcd35d..b9864a3f8f317 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewaySkuTier.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewaySkuTier. @@ -23,3 +23,4 @@ public static class VirtualNetworkGatewaySkuTier public const string UltraPerformance = "UltraPerformance"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs index 29387f435ab32..9d561301add9a 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkGatewayType.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkGatewayType. @@ -21,3 +21,4 @@ public static class VirtualNetworkGatewayType public const string ExpressRoute = "ExpressRoute"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs index 45bdd6d79c3f5..025dfd522ac65 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeering.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// Peerings in a VirtualNework resource + /// Peerings in a virtual network resource. /// [JsonTransformation] public partial class VirtualNetworkPeering : SubResource @@ -30,6 +30,34 @@ public VirtualNetworkPeering() { } /// /// Initializes a new instance of the VirtualNetworkPeering class. /// + /// Resource ID. + /// Whether the VMs in the + /// linked virtual network space would be able to access all the VMs in + /// local Virtual network space. + /// Whether the forwarded traffic + /// from the VMs in the remote virtual network will be + /// allowed/disallowed. + /// If gateway links can be used in + /// remote virtual networking to link to this virtual network. + /// If remote gateways can be used on + /// this virtual network. If the flag is set to true, and + /// allowGatewayTransit on remote peering is also true, virtual network + /// will use gateways of remote virtual network for transit. Only one + /// peering can have this flag set to true. This flag cannot be set if + /// virtual network already has a gateway. + /// The reference of the remote + /// virtual network. + /// The status of the virtual network + /// peering. Possible values are 'Initiated', 'Connected', and + /// 'Disconnected'. Possible values include: 'Initiated', 'Connected', + /// 'Disconnected' + /// The provisioning state of the + /// resource. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VirtualNetworkPeering(string id = default(string), bool? allowVirtualNetworkAccess = default(bool?), bool? allowForwardedTraffic = default(bool?), bool? allowGatewayTransit = default(bool?), bool? useRemoteGateways = default(bool?), SubResource remoteVirtualNetwork = default(SubResource), string peeringState = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -46,21 +74,21 @@ public VirtualNetworkPeering() { } /// /// Gets or sets whether the VMs in the linked virtual network space - /// would be able to access all the VMs in local Virtual network space + /// would be able to access all the VMs in local Virtual network space. /// [JsonProperty(PropertyName = "properties.allowVirtualNetworkAccess")] public bool? AllowVirtualNetworkAccess { get; set; } /// /// Gets or sets whether the forwarded traffic from the VMs in the - /// remote virtual network will be allowed/disallowed + /// remote virtual network will be allowed/disallowed. /// [JsonProperty(PropertyName = "properties.allowForwardedTraffic")] public bool? AllowForwardedTraffic { get; set; } /// - /// Gets or sets if gatewayLinks can be used in remote virtual - /// network’s link to this virtual network + /// Gets or sets if gateway links can be used in remote virtual + /// networking to link to this virtual network. /// [JsonProperty(PropertyName = "properties.allowGatewayTransit")] public bool? AllowGatewayTransit { get; set; } @@ -69,7 +97,7 @@ public VirtualNetworkPeering() { } /// Gets or sets if remote gateways can be used on this virtual /// network. If the flag is set to true, and allowGatewayTransit on /// remote peering is also true, virtual network will use gateways of - /// remote virtual network for transit. Only 1 peering can have this + /// remote virtual network for transit. Only one peering can have this /// flag set to true. This flag cannot be set if virtual network /// already has a gateway. /// @@ -77,37 +105,39 @@ public VirtualNetworkPeering() { } public bool? UseRemoteGateways { get; set; } /// - /// Gets or sets the reference of the remote virtual network + /// Gets or sets the reference of the remote virtual network. /// [JsonProperty(PropertyName = "properties.remoteVirtualNetwork")] public SubResource RemoteVirtualNetwork { get; set; } /// - /// Gets the status of the virtual network peering. Possible values - /// include: 'Initiated', 'Connected', 'Disconnected' + /// Gets or sets the status of the virtual network peering. Possible + /// values are 'Initiated', 'Connected', and 'Disconnected'. Possible + /// values include: 'Initiated', 'Connected', 'Disconnected' /// [JsonProperty(PropertyName = "properties.peeringState")] public string PeeringState { get; set; } /// - /// Gets provisioning state of the resource + /// Gets or sets the provisioning state of the resource. /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } /// /// Gets or sets the name of the resource that is unique within a - /// resource group. This name can be used to access the resource + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs index ee6ed0ee3b830..7d3bcce13a86e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VirtualNetworkPeeringState.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VirtualNetworkPeeringState. @@ -22,3 +22,4 @@ public static class VirtualNetworkPeeringState public const string Disconnected = "Disconnected"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs index 9537876d38195..44504d2731029 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientConfiguration.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Collections; + using System.Collections.Generic; + using System.Linq; /// - /// VpnClientConfiguration for P2S client + /// VpnClientConfiguration for P2S client. /// public partial class VpnClientConfiguration { @@ -29,6 +29,14 @@ public VpnClientConfiguration() { } /// /// Initializes a new instance of the VpnClientConfiguration class. /// + /// The reference of the address + /// space resource which represents Address space for P2S + /// VpnClient. + /// VpnClientRootCertificate + /// for virtual network gateway. + /// VpnClientRevokedCertificate for + /// Virtual network gateway. public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList)) { VpnClientAddressPool = vpnClientAddressPool; @@ -37,23 +45,25 @@ public VpnClientConfiguration() { } } /// - /// Gets or sets the reference of the Address space resource which + /// Gets or sets the reference of the address space resource which /// represents Address space for P2S VpnClient. /// [JsonProperty(PropertyName = "vpnClientAddressPool")] public AddressSpace VpnClientAddressPool { get; set; } /// - /// VpnClientRootCertificate for Virtual network gateway. + /// Gets or sets vpnClientRootCertificate for virtual network gateway. /// [JsonProperty(PropertyName = "vpnClientRootCertificates")] public IList VpnClientRootCertificates { get; set; } /// - /// VpnClientRevokedCertificate for Virtual network gateway. + /// Gets or sets vpnClientRevokedCertificate for Virtual network + /// gateway. /// [JsonProperty(PropertyName = "vpnClientRevokedCertificates")] public IList VpnClientRevokedCertificates { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs index 3894856ab01e5..5fae80b656596 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientParameters.cs @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// VpnClientParameters @@ -29,21 +28,27 @@ public VpnClientParameters() { } /// /// Initializes a new instance of the VpnClientParameters class. /// + /// VPN client Processor + /// Architecture. Possible values are: 'AMD64' and 'X86'. Possible + /// values include: 'Amd64', 'X86' public VpnClientParameters(string processorArchitecture) { ProcessorArchitecture = processorArchitecture; } /// - /// VPN client Processor Architecture -Amd64/X86. Possible values - /// include: 'Amd64', 'X86' + /// Gets or sets VPN client Processor Architecture. Possible values + /// are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' /// [JsonProperty(PropertyName = "ProcessorArchitecture")] public string ProcessorArchitecture { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (ProcessorArchitecture == null) @@ -53,3 +58,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs index 275172bef8390..4b0a7e9148e86 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRevokedCertificate.cs @@ -1,23 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// - /// VPN client revoked certificate of virtual network gateway + /// VPN client revoked certificate of virtual network gateway. /// [JsonTransformation] public partial class VpnClientRevokedCertificate : SubResource @@ -32,6 +32,17 @@ public VpnClientRevokedCertificate() { } /// Initializes a new instance of the VpnClientRevokedCertificate /// class. /// + /// Resource ID. + /// The revoked VPN client certificate + /// thumbprint. + /// The provisioning state of the VPN + /// client revoked certificate resource. Possible values are: + /// 'Updating', 'Deleting', and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VpnClientRevokedCertificate(string id = default(string), string thumbprint = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -42,31 +53,33 @@ public VpnClientRevokedCertificate() { } } /// - /// Gets or sets the revoked Vpn client certificate thumbprint + /// Gets or sets the revoked VPN client certificate thumbprint. /// [JsonProperty(PropertyName = "properties.thumbprint")] public string Thumbprint { get; set; } /// - /// Gets provisioning state of the VPN client revoked certificate - /// resource Updating/Deleting/Failed + /// Gets the provisioning state of the VPN client revoked certificate + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs index 6fe0f3ac1d4a3..a94d64a764d69 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnClientRootCertificate.cs @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using System; - using System.Linq; - using System.Collections.Generic; + using Azure; + using Management; + using Network; + using Rest; + using Rest.Serialization; using Newtonsoft.Json; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Microsoft.Rest.Azure; + using System.Linq; /// /// VPN client root certificate of virtual network gateway @@ -30,6 +30,16 @@ public VpnClientRootCertificate() { } /// /// Initializes a new instance of the VpnClientRootCertificate class. /// + /// The certificate public data. + /// Resource ID. + /// The provisioning state of the VPN + /// client root certificate resource. Possible values are: 'Updating', + /// 'Deleting', and 'Failed'. + /// The name of the resource that is unique within a + /// resource group. This name can be used to access the + /// resource. + /// A unique read-only string that changes whenever + /// the resource is updated. public VpnClientRootCertificate(string publicCertData, string id = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { @@ -40,35 +50,39 @@ public VpnClientRootCertificate() { } } /// - /// Gets or sets the certificate public data + /// Gets or sets the certificate public data. /// [JsonProperty(PropertyName = "properties.publicCertData")] public string PublicCertData { get; set; } /// - /// Gets provisioning state of the VPN client root certificate - /// resource Updating/Deleting/Failed + /// Gets the provisioning state of the VPN client root certificate + /// resource. Possible values are: 'Updating', 'Deleting', and + /// 'Failed'. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } + public string ProvisioningState { get; protected set; } /// - /// Gets name of the resource that is unique within a resource group. - /// This name can be used to access the resource + /// Gets or sets the name of the resource that is unique within a + /// resource group. This name can be used to access the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// A unique read-only string that changes whenever the resource is - /// updated + /// Gets or sets a unique read-only string that changes whenever the + /// resource is updated. /// [JsonProperty(PropertyName = "etag")] public string Etag { get; set; } /// - /// Validate the object. Throws ValidationException if validation fails. + /// Validate the object. /// + /// + /// Thrown if validation fails + /// public virtual void Validate() { if (PublicCertData == null) @@ -78,3 +92,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs index 65c2663915561..2c0724c627d18 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/Models/VpnType.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime.Serialization; + using Azure; + using Management; + using Network; /// /// Defines values for VpnType. @@ -21,3 +21,4 @@ public static class VpnType public const string RouteBased = "RouteBased"; } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs index 137300c6a05d5..8dc3c53c36ed8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// NetworkInterfacesOperations operations. @@ -35,13 +33,16 @@ internal partial class NetworkInterfacesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal NetworkInterfacesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The name of the resource group. @@ -69,11 +70,11 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Gets information about the specified network interface. /// /// /// The name of the resource group. @@ -81,16 +82,31 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The name of the network interface. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -100,11 +116,11 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -117,41 +133,46 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -168,10 +189,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -179,7 +200,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -187,10 +208,23 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -209,13 +243,31 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -224,8 +276,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The Get network interface operation retrieves information about the - /// specified network interface. + /// Creates or updates a network interface. /// /// /// The name of the resource group. @@ -233,8 +284,37 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The name of the network interface. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update network interface operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual machine scale set. + /// + /// + /// The virtual machine index. /// /// /// Headers that will be added to request. @@ -242,24 +322,40 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkInterfaceName == null) + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } - if (this.Client.ApiVersion == null) + if (virtualmachineIndex == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -271,47 +367,44 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("expand", expand); + tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); + tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -328,10 +421,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -339,7 +432,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -353,14 +446,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -382,7 +475,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,9 +488,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,44 +508,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The Put NetworkInterface operation creates/updates a networkInterface - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create/update NetworkInterface operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, networkInterfaceName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The name of the resource group. /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create/update NetworkInterface operation + /// + /// The name of the virtual machine scale set. /// /// /// Headers that will be added to request. @@ -460,28 +522,36 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkInterfaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); - } - if (parameters == null) + if (virtualMachineScaleSetName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -493,43 +563,42 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -545,17 +614,11 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -563,7 +626,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -571,20 +634,20 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -606,7 +669,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -614,32 +677,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -657,8 +702,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The name of the resource group. @@ -669,16 +713,34 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The virtual machine index. /// + /// + /// The name of the network interface. + /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetVMNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -692,11 +754,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); } - if (this.Client.ApiVersion == null) + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -710,42 +776,49 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetVMNetworkInterfaces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{virtualmachineIndex}", Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualMachineScaleSetName}", System.Uri.EscapeDataString(virtualMachineScaleSetName)); + _url = _url.Replace("{virtualmachineIndex}", System.Uri.EscapeDataString(virtualmachineIndex)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -762,10 +835,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -773,7 +846,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -787,14 +860,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -816,7 +889,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -829,9 +902,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -849,39 +922,36 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual machine scale set. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListVirtualMachineScaleSetNetworkInterfacesWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualMachineScaleSetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -892,43 +962,39 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListVirtualMachineScaleSetNetworkInterfaces", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -945,10 +1011,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -956,7 +1022,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -970,14 +1036,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1012,9 +1078,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1032,56 +1098,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The Get network interface operation retrieves information about the - /// specified network interface in a virtual machine scale set. + /// Gets all network interfaces in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual machine scale set. - /// - /// - /// The virtual machine index. - /// - /// - /// The name of the network interface. - /// - /// - /// expand references resources. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetVirtualMachineScaleSetNetworkInterfaceWithHttpMessagesAsync(string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualMachineScaleSetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualMachineScaleSetName"); - } - if (virtualmachineIndex == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualmachineIndex"); - } - if (networkInterfaceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1093,51 +1146,40 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualMachineScaleSetName", virtualMachineScaleSetName); - tracingParameters.Add("virtualmachineIndex", virtualmachineIndex); - tracingParameters.Add("networkInterfaceName", networkInterfaceName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetVirtualMachineScaleSetNetworkInterface", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualMachineScaleSetName}", Uri.EscapeDataString(virtualMachineScaleSetName)); - _url = _url.Replace("{virtualmachineIndex}", Uri.EscapeDataString(virtualmachineIndex)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1154,10 +1196,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1165,7 +1207,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1179,14 +1221,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1208,7 +1250,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1221,9 +1263,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1241,25 +1283,93 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all route tables applied to a network interface. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync( + resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all network security groups applied to a network interface. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync( + resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Deletes the specified network interface. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1270,39 +1380,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1319,10 +1433,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1330,7 +1444,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1338,22 +1452,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1373,31 +1479,13 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1406,32 +1494,57 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Creates or updates a network interface. /// /// /// The name of the resource group. /// + /// + /// The name of the network interface. + /// + /// + /// Parameters supplied to the create or update network interface operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (networkInterfaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1443,40 +1556,43 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkInterfaceName", networkInterfaceName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1492,11 +1608,17 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1504,7 +1626,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1512,20 +1634,20 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1547,7 +1669,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1555,14 +1677,32 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1580,32 +1720,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync( - resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The name of the resource group. @@ -1619,6 +1734,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1632,11 +1759,11 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1653,37 +1780,37 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginGetEffectiveRouteTable", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1700,10 +1827,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1711,7 +1838,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1725,14 +1852,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1767,9 +1894,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1787,32 +1914,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync( - resourceGroupName, networkInterfaceName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The name of the resource group. @@ -1826,6 +1928,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1839,11 +1953,11 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkInterfaceName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1860,37 +1974,37 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "BeginListEffectiveNetworkSecurityGroups", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkInterfaceName}", Uri.EscapeDataString(networkInterfaceName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkInterfaceName}", System.Uri.EscapeDataString(networkInterfaceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1907,10 +2021,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1918,7 +2032,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1932,14 +2046,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1974,9 +2088,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1994,8 +2108,8 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -2006,6 +2120,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -2032,25 +2158,25 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2067,10 +2193,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -2078,7 +2204,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -2092,14 +2218,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2134,9 +2260,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2154,8 +2280,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The NextLink from the previous successful call to List operation. @@ -2166,6 +2291,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -2192,25 +2329,25 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2227,10 +2364,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -2238,7 +2375,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -2252,14 +2389,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2294,9 +2431,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2314,8 +2451,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -2326,6 +2462,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -2352,25 +2500,25 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2387,10 +2535,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -2398,7 +2546,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -2412,14 +2560,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2454,9 +2602,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2474,8 +2622,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -2486,6 +2633,18 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -2512,25 +2671,25 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2547,10 +2706,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -2558,7 +2717,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -2572,14 +2731,14 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -2614,9 +2773,9 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -2635,3 +2794,4 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs index b563aa1737ab7..eec00ec48d67c 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for NetworkInterfacesOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class NetworkInterfacesOperationsExtensions { /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -36,11 +35,11 @@ public static partial class NetworkInterfacesOperationsExtensions /// public static void Delete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).DeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).DeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -60,45 +59,7 @@ public static void Delete(this INetworkInterfacesOperations operations, string r } /// - /// The delete netwokInterface operation deletes the specified netwokInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) - { - Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginDeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// The delete netwokInterface operation deletes the specified netwokInterface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); - } - - /// - /// The Get network interface operation retrieves information about the - /// specified network interface. + /// Gets information about the specified network interface. /// /// /// The operations group for this extension method. @@ -110,7 +71,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static NetworkInterface Get(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, string expand = default(string)) { @@ -118,8 +79,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str } /// - /// The Get network interface operation retrieves information about the - /// specified network interface. + /// Gets information about the specified network interface. /// /// /// The operations group for this extension method. @@ -131,7 +91,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. @@ -145,7 +105,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The operations group for this extension method. @@ -157,7 +117,7 @@ public static void BeginDelete(this INetworkInterfacesOperations operations, str /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) { @@ -165,7 +125,7 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations } /// - /// The Put NetworkInterface operation creates/updates a networkInterface + /// Creates or updates a network interface. /// /// /// The operations group for this extension method. @@ -177,7 +137,7 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations /// The name of the network interface. /// /// - /// Parameters supplied to the create/update NetworkInterface operation + /// Parameters supplied to the create or update network interface operation. /// /// /// The cancellation token. @@ -191,54 +151,8 @@ public static NetworkInterface CreateOrUpdate(this INetworkInterfacesOperations } /// - /// The Put NetworkInterface operation creates/updates a networkInterface - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create/update NetworkInterface operation - /// - public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) - { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// The Put NetworkInterface operation creates/updates a networkInterface - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network interface. - /// - /// - /// Parameters supplied to the create/update NetworkInterface operation - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -258,8 +172,8 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -285,8 +199,7 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -303,8 +216,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -327,8 +239,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The Get network interface operation retrieves information about the - /// specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -346,7 +257,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// public static NetworkInterface GetVirtualMachineScaleSetNetworkInterface(this INetworkInterfacesOperations operations, string resourceGroupName, string virtualMachineScaleSetName, string virtualmachineIndex, string networkInterfaceName, string expand = default(string)) { @@ -354,8 +265,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The Get network interface operation retrieves information about the - /// specified network interface in a virtual machine scale set. + /// Get the specified network interface in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -373,7 +283,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface /// The name of the network interface. /// /// - /// expand references resources. + /// Expands referenced resources. /// /// /// The cancellation token. @@ -387,8 +297,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -399,8 +308,7 @@ public static IPage ListAll(this INetworkInterfacesOperations } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -417,8 +325,7 @@ public static IPage ListAll(this INetworkInterfacesOperations } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -432,8 +339,7 @@ public static IPage List(this INetworkInterfacesOperations ope } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -453,8 +359,7 @@ public static IPage List(this INetworkInterfacesOperations ope } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The operations group for this extension method. @@ -471,8 +376,7 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all route tables applied to a network interface. /// /// /// The operations group for this extension method. @@ -495,8 +399,7 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -507,14 +410,13 @@ public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInter /// /// The name of the network interface. /// - public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The get effective routetable operation retrieves all the route tables - /// applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -528,17 +430,16 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork /// /// The cancellation token. /// - public static async Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -549,14 +450,13 @@ public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetwork /// /// The name of the network interface. /// - public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static void BeginDelete(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { - return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginDeleteAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Deletes the specified network interface. /// /// /// The operations group for this extension method. @@ -570,17 +470,99 @@ public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecuri /// /// The cancellation token. /// - public static async Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// Parameters supplied to the create or update network interface operation. + /// + public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters) + { + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// Parameters supplied to the create or update network interface operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, NetworkInterface parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + { + return Task.Factory.StartNew(s => ((INetworkInterfacesOperations)s).BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets all route tables applied to a network interface. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network interface. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -597,8 +579,7 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS } /// - /// The list effective network security group operation retrieves all the - /// network security groups applied on a networkInterface. + /// Gets all network security groups applied to a network interface. /// /// /// The operations group for this extension method. @@ -621,8 +602,8 @@ public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkS } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -636,8 +617,8 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine from a virtual machine scale set. + /// Gets information about all network interfaces in a virtual machine in a + /// virtual machine scale set. /// /// /// The operations group for this extension method. @@ -657,8 +638,7 @@ public static IPage ListVirtualMachineScaleSetVMNetworkInterfa } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -672,8 +652,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The list network interface operation retrieves information about all - /// network interfaces in a virtual machine scale set. + /// Gets all network interfaces in a virtual machine scale set. /// /// /// The operations group for this extension method. @@ -693,8 +672,7 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -708,8 +686,7 @@ public static IPage ListAllNext(this INetworkInterfacesOperati } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a subscription. + /// Gets all network interfaces in a subscription. /// /// /// The operations group for this extension method. @@ -729,8 +706,7 @@ public static IPage ListAllNext(this INetworkInterfacesOperati } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -744,8 +720,7 @@ public static IPage ListNext(this INetworkInterfacesOperations } /// - /// The List networkInterfaces operation retrieves all the networkInterfaces - /// in a resource group. + /// Gets all network interfaces in a resource group. /// /// /// The operations group for this extension method. @@ -766,3 +741,4 @@ public static IPage ListNext(this INetworkInterfacesOperations } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs index a5b6bc85e2b08..a506d0a8d0745 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClient.cs @@ -1,29 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; using System.Collections.Generic; - using System.Diagnostics; + using System.Linq; using System.Net; using System.Net.Http; - using System.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// The Microsoft Azure Network management API provides a RESTful set of @@ -37,32 +35,32 @@ public partial class NetworkManagementClient : ServiceClient /// The base URI of the service. /// - public Uri BaseUri { get; set; } + 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; } /// - /// Gets Azure subscription credentials. + /// Credentials needed for the client to connect to Azure. /// public ServiceClientCredentials Credentials { get; private set; } /// - /// Gets subscription credentials which uniquely identify Microsoft Azure + /// The subscription credentials which uniquely identify the Microsoft Azure /// subscription. The subscription ID forms part of the URI for every service /// call. /// public string SubscriptionId { get; set; } /// - /// Client Api Version. + /// Client API version. /// public string ApiVersion { get; private set; } @@ -184,9 +182,9 @@ public partial class NetworkManagementClient : ServiceClient /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected NetworkManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -198,9 +196,9 @@ protected NetworkManagementClient(params DelegatingHandler[] handlers) : base(ha /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected NetworkManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -212,13 +210,16 @@ protected NetworkManagementClient(HttpClientHandler rootHandler, params Delegati /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + protected NetworkManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -233,34 +234,40 @@ protected NetworkManagementClient(Uri baseUri, params DelegatingHandler[] handle /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected NetworkManagementClient(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + protected NetworkManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// /// Initializes a new instance of the NetworkManagementClient class. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -268,7 +275,7 @@ public NetworkManagementClient(ServiceClientCredentials credentials, params Dele /// Initializes a new instance of the NetworkManagementClient class. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -276,16 +283,19 @@ public NetworkManagementClient(ServiceClientCredentials credentials, params Dele /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -296,26 +306,29 @@ public NetworkManagementClient(ServiceClientCredentials credentials, HttpClientH /// Optional. The base URI of the service. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -326,7 +339,7 @@ public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials /// Optional. The base URI of the service. /// /// - /// Required. Gets Azure subscription credentials. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -334,87 +347,95 @@ public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials /// /// Optional. The delegating handlers to add to the http client pipeline. /// - public NetworkManagementClient(Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + /// + /// Thrown when a required parameter is null + /// + public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { - throw new ArgumentNullException("baseUri"); + throw new System.ArgumentNullException("baseUri"); } if (credentials == null) { - throw new ArgumentNullException("credentials"); + throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); /// /// Initializes client properties. /// private void Initialize() { - this.ApplicationGateways = new ApplicationGatewaysOperations(this); - this.ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); - this.ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); - this.ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); - this.ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); - this.LoadBalancers = new LoadBalancersOperations(this); - this.LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); - this.NetworkInterfaces = new NetworkInterfacesOperations(this); - this.NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); - this.PublicIPAddresses = new PublicIPAddressesOperations(this); - this.RouteTables = new RouteTablesOperations(this); - this.Routes = new RoutesOperations(this); - this.SecurityRules = new SecurityRulesOperations(this); - this.Subnets = new SubnetsOperations(this); - this.VirtualNetworkPeerings = new VirtualNetworkPeeringsOperations(this); - this.Usages = new UsagesOperations(this); - this.VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); - this.VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); - this.VirtualNetworks = new VirtualNetworksOperations(this); - this.BaseUri = new Uri("https://management.azure.com"); - this.ApiVersion = "2016-09-01"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + ApplicationGateways = new ApplicationGatewaysOperations(this); + ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); + ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); + ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); + ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); + LoadBalancers = new LoadBalancersOperations(this); + LocalNetworkGateways = new LocalNetworkGatewaysOperations(this); + NetworkInterfaces = new NetworkInterfacesOperations(this); + NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); + PublicIPAddresses = new PublicIPAddressesOperations(this); + RouteTables = new RouteTablesOperations(this); + Routes = new RoutesOperations(this); + SecurityRules = new SecurityRulesOperations(this); + Subnets = new SubnetsOperations(this); + VirtualNetworkPeerings = new VirtualNetworkPeeringsOperations(this); + Usages = new UsagesOperations(this); + VirtualNetworkGatewayConnections = new VirtualNetworkGatewayConnectionsOperations(this); + VirtualNetworkGateways = new VirtualNetworkGatewaysOperations(this); + VirtualNetworks = new VirtualNetworksOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2016-09-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { - Formatting = Formatting.Indented, - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + 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 + Converters = new System.Collections.Generic.List { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + 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 + Converters = new System.Collections.Generic.List { new Iso8601TimeSpanConverter() } }; + CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } /// /// Checks whether a domain name in the cloudapp.net zone is available for use. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following regular @@ -426,6 +447,18 @@ 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 + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -435,11 +468,11 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (this.ApiVersion == null) + if (ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); } - if (this.SubscriptionId == null) + if (SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } @@ -456,40 +489,40 @@ private void Initialize() ServiceClientTracing.Enter(_invocationId, this, "CheckDnsNameAvailability", tracingParameters); } // Construct URL - var _baseUrl = this.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability").ToString(); - _url = _url.Replace("{location}", Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.SubscriptionId)); + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); List _queryParameters = new List(); if (domainNameLabel != null) { - _queryParameters.Add(string.Format("domainNameLabel={0}", Uri.EscapeDataString(domainNameLabel))); + _queryParameters.Add(string.Format("domainNameLabel={0}", System.Uri.EscapeDataString(domainNameLabel))); } - if (this.ApiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.GenerateClientRequestId != null && this.GenerateClientRequestId.Value) + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.AcceptLanguage != null) + if (AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); } if (customHeaders != null) { @@ -506,10 +539,10 @@ private void Initialize() // Serialize Request string _requestContent = null; // Set Credentials - if (this.Credentials != null) + if (Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -517,7 +550,7 @@ private void Initialize() ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -531,14 +564,14 @@ private void Initialize() try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -573,9 +606,9 @@ private void Initialize() _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -594,3 +627,4 @@ private void Initialize() } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs index 431d5a9de1381..081b5898ca456 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkManagementClientExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for NetworkManagementClient. @@ -29,7 +28,7 @@ public static partial class NetworkManagementClientExtensions /// The operations group for this extension method. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following regular @@ -47,7 +46,7 @@ public static partial class NetworkManagementClientExtensions /// The operations group for this extension method. /// /// - /// The location of the domain name + /// The location of the domain name. /// /// /// The domain name to be verified. It must conform to the following regular @@ -66,3 +65,4 @@ public static partial class NetworkManagementClientExtensions } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs index b2f92d57dfbd1..0cf2029597a50 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// NetworkSecurityGroupsOperations operations. @@ -35,13 +33,16 @@ internal partial class NetworkSecurityGroupsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The name of the resource group. @@ -70,12 +70,11 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Gets the specified network security group. /// /// /// The name of the resource group. @@ -83,16 +82,31 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The name of the network security group. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -102,11 +116,11 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -119,41 +133,46 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -170,10 +189,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -181,7 +200,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -189,10 +208,23 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -211,13 +243,31 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -226,8 +276,8 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The Get NetworkSecurityGroups operation retrieves information about the - /// specified network security group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. @@ -235,33 +285,57 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The name of the network security group. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update network security group + /// operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all network security groups in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkSecurityGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -272,48 +346,39 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -330,10 +395,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -341,7 +406,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -355,14 +420,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -384,7 +449,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -397,9 +462,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -417,75 +482,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, networkSecurityGroupName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Gets all network security groups in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkSecurityGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -497,43 +530,40 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -549,17 +579,11 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -567,7 +591,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -575,20 +599,20 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -610,7 +634,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -618,32 +642,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -661,25 +667,47 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Deletes the specified network security group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -690,39 +718,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -739,10 +771,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -750,7 +782,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -758,22 +790,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -793,31 +817,13 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -826,32 +832,59 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The name of the resource group. /// + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (networkSecurityGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -863,40 +896,43 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -912,11 +948,17 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -924,7 +966,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -932,20 +974,20 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -967,7 +1009,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -975,14 +1017,32 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1000,8 +1060,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1012,6 +1071,18 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1038,25 +1109,25 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1073,10 +1144,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1084,7 +1155,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1098,14 +1169,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1140,9 +1211,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1160,8 +1231,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1172,6 +1242,18 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1198,25 +1280,25 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1233,10 +1315,10 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1244,7 +1326,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1258,14 +1340,14 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1300,9 +1382,9 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1321,3 +1403,4 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs index 9e23ef2620e52..448b613f38c6e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/NetworkSecurityGroupsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for NetworkSecurityGroupsOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class NetworkSecurityGroupsOperationsExtensions { /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. @@ -37,12 +35,11 @@ public static partial class NetworkSecurityGroupsOperationsExtensions /// public static void Delete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) { - Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. @@ -62,8 +59,7 @@ public static void Delete(this INetworkSecurityGroupsOperations operations, stri } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Gets the specified network security group. /// /// /// The operations group for this extension method. @@ -74,14 +70,16 @@ public static void Delete(this INetworkSecurityGroupsOperations operations, stri /// /// The name of the network security group. /// - public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) + /// + /// Expands referenced resources. + /// + public static NetworkSecurityGroup Get(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string)) { - Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete NetworkSecurityGroup operation deletes the specified network - /// security group + /// Gets the specified network security group. /// /// /// The operations group for this extension method. @@ -92,17 +90,23 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// /// The name of the network security group. /// + /// + /// Expands referenced resources. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get NetworkSecurityGroups operation retrieves information about the - /// specified network security group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -113,17 +117,18 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// /// The name of the network security group. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update network security group + /// operation. /// - public static NetworkSecurityGroup Get(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string)) + public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get NetworkSecurityGroups operation retrieves information about the - /// specified network security group. + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -134,71 +139,51 @@ public static void BeginDelete(this INetworkSecurityGroupsOperations operations, /// /// The name of the network security group. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update network security group + /// operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group operation - /// - public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) + public static IPage ListAll(this INetworkSecurityGroupsOperations operations) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -206,20 +191,13 @@ public static NetworkSecurityGroup CreateOrUpdate(this INetworkSecurityGroupsOpe /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group operation - /// - public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) + public static IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put NetworkSecurityGroup operation creates/updates a network security - /// group in the specified resource group. + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -227,56 +205,57 @@ public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGrou /// /// The name of the resource group. /// - /// - /// The name of the network security group. - /// - /// - /// Parameters supplied to the create/update Network Security Group operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this INetworkSecurityGroupsOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// + public static void BeginDelete(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Deletes the specified network security group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this INetworkSecurityGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -284,14 +263,21 @@ public static IPage ListAll(this INetworkSecurityGroupsOpe /// /// The name of the resource group. /// - public static IPage List(this INetworkSecurityGroupsOperations operations, string resourceGroupName) + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// + public static NetworkSecurityGroup BeginCreateOrUpdate(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters) { - return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((INetworkSecurityGroupsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Creates or updates a network security group in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -299,20 +285,26 @@ public static IPage List(this INetworkSecurityGroupsOperat /// /// The name of the resource group. /// + /// + /// The name of the network security group. + /// + /// + /// Parameters supplied to the create or update network security group + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this INetworkSecurityGroupsOperations operations, string resourceGroupName, string networkSecurityGroupName, NetworkSecurityGroup parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. @@ -326,8 +318,7 @@ public static IPage ListAllNext(this INetworkSecurityGroup } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// subscription + /// Gets all network security groups in a subscription. /// /// /// The operations group for this extension method. @@ -347,8 +338,7 @@ public static IPage ListAllNext(this INetworkSecurityGroup } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -362,8 +352,7 @@ public static IPage ListNext(this INetworkSecurityGroupsOp } /// - /// The list NetworkSecurityGroups returns all network security groups in a - /// resource group + /// Gets all network security groups in a resource group. /// /// /// The operations group for this extension method. @@ -384,3 +373,4 @@ public static IPage ListNext(this INetworkSecurityGroupsOp } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs index 0f4c99fc285e7..26f7750ea03c8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// PublicIPAddressesOperations operations. @@ -35,13 +33,16 @@ internal partial class PublicIPAddressesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal PublicIPAddressesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The name of the resource group. @@ -69,11 +70,11 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, publicIpAddressName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Gets the specified public IP address in a specified resource group. /// /// /// The name of the resource group. @@ -81,16 +82,31 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -100,11 +116,11 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -117,41 +133,46 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("publicIpAddressName", publicIpAddressName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -168,10 +189,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -179,7 +200,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -187,10 +208,23 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -209,13 +243,31 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -224,42 +276,64 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// /// - /// The name of the subnet. + /// The name of the public IP address. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update public IP address operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all the public IP addresses in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (publicIpAddressName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -270,48 +344,39 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -328,10 +393,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -339,7 +404,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -353,14 +418,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -382,7 +447,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,9 +460,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,75 +480,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all public IP addresses in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, publicIpAddressName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (publicIpAddressName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -495,43 +528,40 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("publicIpAddressName", publicIpAddressName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{publicIpAddressName}", Uri.EscapeDataString(publicIpAddressName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -547,17 +577,11 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -565,7 +589,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -573,20 +597,20 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -608,7 +632,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -616,32 +640,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -659,25 +665,47 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Deletes the specified public IP address. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (publicIpAddressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -688,39 +716,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpAddressName", publicIpAddressName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -737,10 +769,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -748,7 +780,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -756,22 +788,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -791,31 +815,13 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -824,32 +830,57 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The name of the resource group. /// + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (publicIpAddressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "publicIpAddressName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -861,40 +892,43 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("publicIpAddressName", publicIpAddressName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{publicIpAddressName}", System.Uri.EscapeDataString(publicIpAddressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -910,11 +944,17 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -922,7 +962,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -930,20 +970,20 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -965,7 +1005,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -973,14 +1013,32 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -998,8 +1056,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1010,6 +1067,18 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1036,25 +1105,25 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1071,10 +1140,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1082,7 +1151,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1096,14 +1165,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1138,9 +1207,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1158,8 +1227,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1170,6 +1238,18 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1196,25 +1276,25 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1231,10 +1311,10 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1242,7 +1322,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1256,14 +1336,14 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1298,9 +1378,9 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1319,3 +1399,4 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs index 423275dd0df4f..0006826483336 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/PublicIpAddressesOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for PublicIPAddressesOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class PublicIPAddressesOperationsExtensions { /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. @@ -36,11 +35,11 @@ public static partial class PublicIPAddressesOperationsExtensions /// public static void Delete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) { - Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).DeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).DeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. @@ -60,7 +59,7 @@ public static void Delete(this IPublicIPAddressesOperations operations, string r } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Gets the specified public IP address in a specified resource group. /// /// /// The operations group for this extension method. @@ -71,13 +70,16 @@ public static void Delete(this IPublicIPAddressesOperations operations, string r /// /// The name of the subnet. /// - public static void BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) + /// + /// Expands referenced resources. + /// + public static PublicIPAddress Get(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string)) { - Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginDeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).GetAsync(resourceGroupName, publicIpAddressName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete publicIpAddress operation deletes the specified publicIpAddress. + /// Gets the specified public IP address in a specified resource group. /// /// /// The operations group for this extension method. @@ -88,17 +90,22 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -107,19 +114,18 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// The name of the resource group. /// /// - /// The name of the subnet. + /// The name of the public IP address. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update public IP address operation. /// - public static PublicIPAddress Get(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string)) + public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).GetAsync(resourceGroupName, publicIpAddressName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get publicIpAddress operation retrieves information about the - /// specified pubicIpAddress + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -128,73 +134,52 @@ public static void BeginDelete(this IPublicIPAddressesOperations operations, str /// The name of the resource group. /// /// - /// The name of the subnet. + /// The name of the public IP address. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update public IP address operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// - public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) + public static IPage ListAll(this IPublicIPAddressesOperations operations) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -202,20 +187,13 @@ public static PublicIPAddress CreateOrUpdate(this IPublicIPAddressesOperations o /// /// The name of the resource group. /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// - public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) + public static IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put PublicIPAddress operation creates/updates a stable/dynamic - /// PublicIP address + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -223,56 +201,56 @@ public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperati /// /// The name of the resource group. /// - /// - /// The name of the publicIpAddress. - /// - /// - /// Parameters supplied to the create/update PublicIPAddress operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IPublicIPAddressesOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// + public static void BeginDelete(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginDeleteAsync(resourceGroupName, publicIpAddressName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Deletes the specified public IP address. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the subnet. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IPublicIPAddressesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -280,14 +258,19 @@ public static IPage ListAll(this IPublicIPAddressesOperations o /// /// The name of the resource group. /// - public static IPage List(this IPublicIPAddressesOperations operations, string resourceGroupName) + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address operation. + /// + public static PublicIPAddress BeginCreateOrUpdate(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters) { - return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IPublicIPAddressesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Creates or updates a static or dynamic public IP address. /// /// /// The operations group for this extension method. @@ -295,20 +278,25 @@ public static IPage List(this IPublicIPAddressesOperations oper /// /// The name of the resource group. /// + /// + /// The name of the public IP address. + /// + /// + /// Parameters supplied to the create or update public IP address operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IPublicIPAddressesOperations operations, string resourceGroupName, string publicIpAddressName, PublicIPAddress parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, publicIpAddressName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. @@ -322,8 +310,7 @@ public static IPage ListAllNext(this IPublicIPAddressesOperatio } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a subscription. + /// Gets all the public IP addresses in a subscription. /// /// /// The operations group for this extension method. @@ -343,8 +330,7 @@ public static IPage ListAllNext(this IPublicIPAddressesOperatio } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -358,8 +344,7 @@ public static IPage ListNext(this IPublicIPAddressesOperations } /// - /// The List publicIpAddress operation retrieves all the publicIpAddresses in - /// a resource group. + /// Gets all public IP addresses in a resource group. /// /// /// The operations group for this extension method. @@ -380,3 +365,4 @@ public static IPage ListNext(this IPublicIPAddressesOperations } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs index 1ab67764026a5..dd3f893669109 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// RouteTablesOperations operations. @@ -35,13 +33,16 @@ internal partial class RouteTablesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal RouteTablesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal RouteTablesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The name of the resource group. @@ -69,11 +70,11 @@ internal RouteTablesOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, routeTableName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Gets the specified route table. /// /// /// The name of the resource group. @@ -81,16 +82,31 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The name of the route table. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -100,11 +116,11 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -117,41 +133,46 @@ internal RouteTablesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -168,10 +189,10 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -179,7 +200,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -187,10 +208,23 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -209,13 +243,31 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -224,8 +276,7 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The Get RouteTables operation retrieves information about the specified - /// route table. + /// Create or updates a route table in a specified resource group. /// /// /// The name of the resource group. @@ -233,8 +284,30 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The name of the route table. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update route table operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all route tables in a resource group. + /// + /// + /// The name of the resource group. /// /// /// Headers that will be added to request. @@ -242,24 +315,32 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (routeTableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -271,47 +352,40 @@ internal RouteTablesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -328,10 +402,10 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -339,7 +413,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -353,14 +427,14 @@ internal RouteTablesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -382,7 +456,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,9 +469,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,75 +489,36 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Gets all route tables in a subscription. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create/update Route Table operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, routeTableName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create/update Route Table operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (routeTableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -494,44 +529,39 @@ internal RouteTablesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -547,17 +577,11 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -565,7 +589,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -573,20 +597,20 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -608,7 +632,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -621,27 +645,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -659,31 +665,47 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The list RouteTables returns all route tables in a resource group + /// Deletes the specified route table. /// /// /// The name of the resource group. /// + /// + /// The name of the route table. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (routeTableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -695,40 +717,42 @@ internal RouteTablesOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -745,10 +769,10 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -756,7 +780,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -764,22 +788,14 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -799,31 +815,13 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -832,24 +830,57 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The list RouteTables returns all route tables in a subscription + /// Create or updates a route table in a specified resource group. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, RouteTable parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (routeTableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -860,39 +891,44 @@ internal RouteTablesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -908,11 +944,17 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -920,7 +962,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -928,20 +970,20 @@ internal RouteTablesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -963,7 +1005,7 @@ internal RouteTablesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -976,9 +1018,27 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -996,7 +1056,7 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1007,6 +1067,18 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1033,25 +1105,25 @@ internal RouteTablesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1068,10 +1140,10 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1079,7 +1151,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1093,14 +1165,14 @@ internal RouteTablesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1135,9 +1207,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1155,7 +1227,7 @@ internal RouteTablesOperations(NetworkManagementClient client) } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1166,6 +1238,18 @@ internal RouteTablesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1192,25 +1276,25 @@ internal RouteTablesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1227,10 +1311,10 @@ internal RouteTablesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1238,7 +1322,7 @@ internal RouteTablesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1252,14 +1336,14 @@ internal RouteTablesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1294,9 +1378,9 @@ internal RouteTablesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1315,3 +1399,4 @@ internal RouteTablesOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs index e63dfe0c990d8..701e924223815 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RouteTablesOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for RouteTablesOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class RouteTablesOperationsExtensions { /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -36,11 +35,11 @@ public static partial class RouteTablesOperationsExtensions /// public static void Delete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) { - Task.Factory.StartNew(s => ((IRouteTablesOperations)s).DeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRouteTablesOperations)s).DeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -60,7 +59,7 @@ public static void Delete(this IRouteTablesOperations operations, string resourc } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Gets the specified route table. /// /// /// The operations group for this extension method. @@ -71,13 +70,16 @@ public static void Delete(this IRouteTablesOperations operations, string resourc /// /// The name of the route table. /// - public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) + /// + /// Expands referenced resources. + /// + public static RouteTable Get(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string)) { - Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).GetAsync(resourceGroupName, routeTableName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete RouteTable operation deletes the specified Route Table + /// Gets the specified route table. /// /// /// The operations group for this extension method. @@ -88,17 +90,22 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// /// The name of the route table. /// + /// + /// Expands referenced resources. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get RouteTables operation retrieves information about the specified - /// route table. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. @@ -109,17 +116,16 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// /// The name of the route table. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update route table operation. /// - public static RouteTable Get(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string)) + public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).GetAsync(resourceGroupName, routeTableName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get RouteTables operation retrieves information about the specified - /// route table. + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. @@ -130,23 +136,22 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// /// The name of the route table. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update route table operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -154,20 +159,13 @@ public static void BeginDelete(this IRouteTablesOperations operations, string re /// /// The name of the resource group. /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create/update Route Table operation - /// - public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) + public static IPage List(this IRouteTablesOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -175,73 +173,47 @@ public static RouteTable CreateOrUpdate(this IRouteTablesOperations operations, /// /// The name of the resource group. /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create/update Route Table operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create/update Route Table operation - /// - public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) + public static IPage ListAll(this IRouteTablesOperations operations) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put RouteTable operation creates/updates a route table in the - /// specified resource group. + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// Parameters supplied to the create/update Route Table operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IRouteTablesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list RouteTables returns all route tables in a resource group + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -249,13 +221,16 @@ public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operati /// /// The name of the resource group. /// - public static IPage List(this IRouteTablesOperations operations, string resourceGroupName) + /// + /// The name of the route table. + /// + public static void BeginDelete(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list RouteTables returns all route tables in a resource group + /// Deletes the specified route table. /// /// /// The operations group for this extension method. @@ -263,47 +238,65 @@ public static IPage List(this IRouteTablesOperations operations, str /// /// The name of the resource group. /// + /// + /// The name of the route table. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IRouteTablesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false); } /// - /// The list RouteTables returns all route tables in a subscription + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IRouteTablesOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// + public static RouteTable BeginCreateOrUpdate(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters) { - return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRouteTablesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list RouteTables returns all route tables in a subscription + /// Create or updates a route table in a specified resource group. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// + /// + /// Parameters supplied to the create or update route table operation. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IRouteTablesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IRouteTablesOperations operations, string resourceGroupName, string routeTableName, RouteTable parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -317,7 +310,7 @@ public static IPage ListNext(this IRouteTablesOperations operations, } /// - /// The list RouteTables returns all route tables in a resource group + /// Gets all route tables in a resource group. /// /// /// The operations group for this extension method. @@ -337,7 +330,7 @@ public static IPage ListNext(this IRouteTablesOperations operations, } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. @@ -351,7 +344,7 @@ public static IPage ListAllNext(this IRouteTablesOperations operatio } /// - /// The list RouteTables returns all route tables in a subscription + /// Gets all route tables in a subscription. /// /// /// The operations group for this extension method. @@ -372,3 +365,4 @@ public static IPage ListAllNext(this IRouteTablesOperations operatio } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs index c86f08e1ec2df..19689b77f4ff8 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// RoutesOperations operations. @@ -35,13 +33,16 @@ internal partial class RoutesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal RoutesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal RoutesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -72,11 +73,11 @@ internal RoutesOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, routeTableName, routeName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete route operation deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The name of the resource group. @@ -93,10 +94,22 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -110,11 +123,11 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -129,41 +142,41 @@ internal RoutesOperations(NetworkManagementClient client) tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -180,10 +193,10 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -191,7 +204,7 @@ internal RoutesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -199,10 +212,23 @@ internal RoutesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -221,13 +247,31 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -236,8 +280,7 @@ internal RoutesOperations(NetworkManagementClient client) } /// - /// The Get route operation retrieves information about the specified route - /// from the route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -248,16 +291,56 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The name of the route. /// + /// + /// Parameters supplied to the create or update route operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all routes in a route table. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the route table. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -267,15 +350,11 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (routeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -288,43 +367,41 @@ internal RoutesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); - tracingParameters.Add("routeName", routeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -341,10 +418,10 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -352,7 +429,7 @@ internal RoutesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -366,14 +443,14 @@ internal RoutesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -395,7 +472,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -408,9 +485,9 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -428,40 +505,7 @@ internal RoutesOperations(NetworkManagementClient client) } /// - /// The Put route operation creates/updates a route in the specified route - /// table - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the route table. - /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create/update route operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, routeTableName, routeName, routeParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Deletes the specified route from a route table. /// /// /// The name of the resource group. @@ -472,19 +516,25 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The name of the route. /// - /// - /// Parameters supplied to the create/update route operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -498,19 +548,11 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); } - if (routeParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routeParameters"); - } - if (routeParameters != null) - { - routeParameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -524,43 +566,42 @@ internal RoutesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); tracingParameters.Add("routeName", routeName); - tracingParameters.Add("routeParameters", routeParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{routeName}", Uri.EscapeDataString(routeName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -576,17 +617,11 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(routeParameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(routeParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -594,7 +629,7 @@ internal RoutesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -602,22 +637,14 @@ internal RoutesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 202 && (int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -637,49 +664,13 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -688,8 +679,7 @@ internal RoutesOperations(NetworkManagementClient client) } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Creates or updates a route in the specified route table. /// /// /// The name of the resource group. @@ -697,16 +687,34 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The name of the route table. /// + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string routeTableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string routeTableName, string routeName, Route routeParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -716,11 +724,23 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - if (this.Client.ApiVersion == null) + if (routeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeName"); + } + if (routeParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "routeParameters"); + } + if (routeParameters != null) + { + routeParameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -733,41 +753,44 @@ internal RoutesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("routeTableName", routeTableName); + tracingParameters.Add("routeName", routeName); + tracingParameters.Add("routeParameters", routeParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{routeTableName}", Uri.EscapeDataString(routeTableName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{routeTableName}", System.Uri.EscapeDataString(routeTableName)); + _url = _url.Replace("{routeName}", System.Uri.EscapeDataString(routeName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -783,11 +806,17 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(routeParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routeParameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -795,7 +824,7 @@ internal RoutesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -803,20 +832,20 @@ internal RoutesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -838,7 +867,7 @@ internal RoutesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -851,9 +880,27 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -871,8 +918,7 @@ internal RoutesOperations(NetworkManagementClient client) } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The NextLink from the previous successful call to List operation. @@ -883,6 +929,18 @@ internal RoutesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -909,25 +967,25 @@ internal RoutesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -944,10 +1002,10 @@ internal RoutesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -955,7 +1013,7 @@ internal RoutesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -969,14 +1027,14 @@ internal RoutesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1011,9 +1069,9 @@ internal RoutesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1032,3 +1090,4 @@ internal RoutesOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs index 98a96d383d6c1..afa230813a413 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/RoutesOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for RoutesOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class RoutesOperationsExtensions { /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -39,11 +38,11 @@ public static partial class RoutesOperationsExtensions /// public static void Delete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - Task.Factory.StartNew(s => ((IRoutesOperations)s).DeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRoutesOperations)s).DeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete route operation deletes the specified route from a route table. + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -66,7 +65,7 @@ public static void Delete(this IRoutesOperations operations, string resourceGrou } /// - /// The delete route operation deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The operations group for this extension method. @@ -80,13 +79,13 @@ public static void Delete(this IRoutesOperations operations, string resourceGrou /// /// The name of the route. /// - public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).GetAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete route operation deletes the specified route from a route table. + /// Gets the specified route from a route table. /// /// /// The operations group for this extension method. @@ -103,14 +102,16 @@ public static void BeginDelete(this IRoutesOperations operations, string resourc /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get route operation retrieves information about the specified route - /// from the route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -124,14 +125,16 @@ public static void BeginDelete(this IRoutesOperations operations, string resourc /// /// The name of the route. /// - public static Route Get(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) + /// + /// Parameters supplied to the create or update route operation. + /// + public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).GetAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get route operation retrieves information about the specified route - /// from the route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -145,20 +148,22 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN /// /// The name of the route. /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -169,20 +174,13 @@ public static Route Get(this IRoutesOperations operations, string resourceGroupN /// /// The name of the route table. /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create/update route operation - /// - public static Route CreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + public static IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).ListAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -193,26 +191,19 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res /// /// The name of the route table. /// - /// - /// The name of the route. - /// - /// - /// Parameters supplied to the create/update route operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -226,17 +217,13 @@ public static Route CreateOrUpdate(this IRoutesOperations operations, string res /// /// The name of the route. /// - /// - /// Parameters supplied to the create/update route operation - /// - public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) + public static void BeginDelete(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginDeleteAsync(resourceGroupName, routeTableName, routeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put route operation creates/updates a route in the specified route - /// table + /// Deletes the specified route from a route table. /// /// /// The operations group for this extension method. @@ -250,23 +237,16 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin /// /// The name of the route. /// - /// - /// Parameters supplied to the create/update route operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -277,14 +257,19 @@ public static Route BeginCreateOrUpdate(this IRoutesOperations operations, strin /// /// The name of the route table. /// - public static IPage List(this IRoutesOperations operations, string resourceGroupName, string routeTableName) + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// + public static Route BeginCreateOrUpdate(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters) { - return Task.Factory.StartNew(s => ((IRoutesOperations)s).ListAsync(resourceGroupName, routeTableName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IRoutesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Creates or updates a route in the specified route table. /// /// /// The operations group for this extension method. @@ -295,20 +280,25 @@ public static IPage List(this IRoutesOperations operations, string resour /// /// The name of the route table. /// + /// + /// The name of the route. + /// + /// + /// Parameters supplied to the create or update route operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IRoutesOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, routeTableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, routeTableName, routeName, routeParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -322,8 +312,7 @@ public static IPage ListNext(this IRoutesOperations operations, string ne } /// - /// The List network security rule operation retrieves all the routes in a - /// route table. + /// Gets all routes in a route table. /// /// /// The operations group for this extension method. @@ -344,3 +333,4 @@ public static IPage ListNext(this IRoutesOperations operations, string ne } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs index b493f61fc4873..436a5c1e0aee0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// SecurityRulesOperations operations. @@ -35,13 +33,16 @@ internal partial class SecurityRulesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal SecurityRulesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -73,12 +73,11 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, networkSecurityGroupName, securityRuleName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Get the specified network security rule. /// /// /// The name of the resource group. @@ -95,10 +94,22 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -112,11 +123,11 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -131,41 +142,41 @@ internal SecurityRulesOperations(NetworkManagementClient client) tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -182,10 +193,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -193,7 +204,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -201,10 +212,23 @@ internal SecurityRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -223,13 +247,31 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -238,8 +280,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) } /// - /// The Get NetworkSecurityRule operation retrieves information about the - /// specified network security rule. + /// Creates or updates a security rule in the specified network security group. /// /// /// The name of the resource group. @@ -250,16 +291,57 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The name of the security rule. /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all security rules in a network security group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security group. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -269,15 +351,11 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (securityRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -290,43 +368,41 @@ internal SecurityRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); - tracingParameters.Add("securityRuleName", securityRuleName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -343,10 +419,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -354,7 +430,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -368,14 +444,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -397,7 +473,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -410,9 +486,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -430,40 +506,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security group. - /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create/update network security rule operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Deletes the specified network security rule. /// /// /// The name of the resource group. @@ -474,19 +517,25 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create/update network security rule operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -500,19 +549,11 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); } - if (securityRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleParameters"); - } - if (securityRuleParameters != null) - { - securityRuleParameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -526,43 +567,42 @@ internal SecurityRulesOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); tracingParameters.Add("securityRuleName", securityRuleName); - tracingParameters.Add("securityRuleParameters", securityRuleParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{securityRuleName}", Uri.EscapeDataString(securityRuleName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -578,17 +618,11 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(securityRuleParameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(securityRuleParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -596,7 +630,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -604,22 +638,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -639,49 +665,13 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -690,8 +680,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Creates or updates a security rule in the specified network security group. /// /// /// The name of the resource group. @@ -699,16 +688,35 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The name of the network security group. /// + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -718,11 +726,23 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroupName"); } - if (this.Client.ApiVersion == null) + if (securityRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName"); + } + if (securityRuleParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleParameters"); + } + if (securityRuleParameters != null) + { + securityRuleParameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -735,41 +755,44 @@ internal SecurityRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("networkSecurityGroupName", networkSecurityGroupName); + tracingParameters.Add("securityRuleName", securityRuleName); + tracingParameters.Add("securityRuleParameters", securityRuleParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityGroupName}", Uri.EscapeDataString(networkSecurityGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityGroupName}", System.Uri.EscapeDataString(networkSecurityGroupName)); + _url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -785,11 +808,17 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(securityRuleParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityRuleParameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -797,7 +826,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -805,20 +834,20 @@ internal SecurityRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -840,7 +869,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -853,9 +882,27 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -873,8 +920,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The NextLink from the previous successful call to List operation. @@ -885,6 +931,18 @@ internal SecurityRulesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -911,25 +969,25 @@ internal SecurityRulesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -946,10 +1004,10 @@ internal SecurityRulesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -957,7 +1015,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -971,14 +1029,14 @@ internal SecurityRulesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1013,9 +1071,9 @@ internal SecurityRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1034,3 +1092,4 @@ internal SecurityRulesOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs index 7f0b4d6526f1d..110e7abc67d9d 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SecurityRulesOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for SecurityRulesOperations. @@ -23,8 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class SecurityRulesOperationsExtensions { /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -40,12 +38,11 @@ public static partial class SecurityRulesOperationsExtensions /// public static void Delete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).DeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -68,8 +65,7 @@ public static void Delete(this ISecurityRulesOperations operations, string resou } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Get the specified network security rule. /// /// /// The operations group for this extension method. @@ -83,14 +79,13 @@ public static void Delete(this ISecurityRulesOperations operations, string resou /// /// The name of the security rule. /// - public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete network security rule operation deletes the specified network - /// security rule. + /// Get the specified network security rule. /// /// /// The operations group for this extension method. @@ -107,14 +102,16 @@ public static void BeginDelete(this ISecurityRulesOperations operations, string /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get NetworkSecurityRule operation retrieves information about the - /// specified network security rule. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -128,14 +125,17 @@ public static void BeginDelete(this ISecurityRulesOperations operations, string /// /// The name of the security rule. /// - public static SecurityRule Get(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// + public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).GetAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get NetworkSecurityRule operation retrieves information about the - /// specified network security rule. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -149,20 +149,23 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string /// /// The name of the security rule. /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -173,20 +176,13 @@ public static SecurityRule Get(this ISecurityRulesOperations operations, string /// /// The name of the network security group. /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create/update network security rule operation - /// - public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + public static IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -197,26 +193,19 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio /// /// The name of the network security group. /// - /// - /// The name of the security rule. - /// - /// - /// Parameters supplied to the create/update network security rule operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -230,17 +219,13 @@ public static SecurityRule CreateOrUpdate(this ISecurityRulesOperations operatio /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create/update network security rule operation - /// - public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) + public static void BeginDelete(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put network security rule operation creates/updates a security rule in - /// the specified network security group + /// Deletes the specified network security rule. /// /// /// The operations group for this extension method. @@ -254,23 +239,16 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope /// /// The name of the security rule. /// - /// - /// Parameters supplied to the create/update network security rule operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -281,14 +259,20 @@ public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations ope /// /// The name of the network security group. /// - public static IPage List(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// + public static SecurityRule BeginCreateOrUpdate(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters) { - return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).ListAsync(resourceGroupName, networkSecurityGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISecurityRulesOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Creates or updates a security rule in the specified network security group. /// /// /// The operations group for this extension method. @@ -299,20 +283,26 @@ public static IPage List(this ISecurityRulesOperations operations, /// /// The name of the network security group. /// + /// + /// The name of the security rule. + /// + /// + /// Parameters supplied to the create or update network security rule + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ISecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string securityRuleName, SecurityRule securityRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -326,8 +316,7 @@ public static IPage ListNext(this ISecurityRulesOperations operati } /// - /// The List network security rule operation retrieves all the security rules - /// in a network security group. + /// Gets all security rules in a network security group. /// /// /// The operations group for this extension method. @@ -348,3 +337,4 @@ public static IPage ListNext(this ISecurityRulesOperations operati } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs index d73f50e71b303..131950d71684b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// SubnetsOperations operations. @@ -35,13 +33,16 @@ internal partial class SubnetsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal SubnetsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal SubnetsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -72,11 +73,11 @@ internal SubnetsOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, subnetName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete subnet operation deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The name of the resource group. @@ -87,16 +88,31 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -110,11 +126,11 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -128,42 +144,47 @@ internal SubnetsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -180,10 +201,10 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -191,7 +212,7 @@ internal SubnetsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -199,10 +220,23 @@ internal SubnetsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -221,13 +255,31 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -236,7 +288,7 @@ internal SubnetsOperations(NetworkManagementClient client) } /// - /// The Get subnet operation retrieves information about the specified subnet. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -247,8 +299,33 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the subnet. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update subnet operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all subnets in a virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. /// /// /// Headers that will be added to request. @@ -256,10 +333,22 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -269,15 +358,11 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (subnetName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -290,48 +375,41 @@ internal SubnetsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -348,10 +426,10 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -359,7 +437,7 @@ internal SubnetsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -373,14 +451,14 @@ internal SubnetsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -402,7 +480,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -415,9 +493,9 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -435,8 +513,7 @@ internal SubnetsOperations(NetworkManagementClient client) } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Deletes the specified subnet. /// /// /// The name of the resource group. @@ -447,51 +524,25 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create/update Subnet operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, virtualNetworkName, subnetName, subnetParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create/update Subnet operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -505,15 +556,11 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); } - if (subnetParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "subnetParameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -527,43 +574,42 @@ internal SubnetsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("subnetName", subnetName); - tracingParameters.Add("subnetParameters", subnetParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subnetName}", Uri.EscapeDataString(subnetName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -579,17 +625,11 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(subnetParameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(subnetParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -597,7 +637,7 @@ internal SubnetsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -605,22 +645,14 @@ internal SubnetsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -640,49 +672,13 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -691,7 +687,7 @@ internal SubnetsOperations(NetworkManagementClient client) } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The name of the resource group. @@ -699,16 +695,34 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -718,11 +732,19 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (subnetName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subnetName"); + } + if (subnetParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subnetParameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -735,41 +757,44 @@ internal SubnetsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("subnetName", subnetName); + tracingParameters.Add("subnetParameters", subnetParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subnetName}", System.Uri.EscapeDataString(subnetName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -785,11 +810,17 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(subnetParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(subnetParameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -797,7 +828,7 @@ internal SubnetsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -805,20 +836,20 @@ internal SubnetsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -840,7 +871,7 @@ internal SubnetsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -853,9 +884,27 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -873,7 +922,7 @@ internal SubnetsOperations(NetworkManagementClient client) } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -884,6 +933,18 @@ internal SubnetsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -910,25 +971,25 @@ internal SubnetsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -945,10 +1006,10 @@ internal SubnetsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -956,7 +1017,7 @@ internal SubnetsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -970,14 +1031,14 @@ internal SubnetsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1012,9 +1073,9 @@ internal SubnetsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1033,3 +1094,4 @@ internal SubnetsOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs index 96a5ce76ab441..e07ab7b9cb912 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/SubnetsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for SubnetsOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class SubnetsOperationsExtensions { /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -39,11 +38,11 @@ public static partial class SubnetsOperationsExtensions /// public static void Delete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) { - Task.Factory.StartNew(s => ((ISubnetsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISubnetsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete subnet operation deletes the specified subnet. + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -66,7 +65,7 @@ public static void Delete(this ISubnetsOperations operations, string resourceGro } /// - /// The delete subnet operation deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The operations group for this extension method. @@ -80,13 +79,16 @@ public static void Delete(this ISubnetsOperations operations, string resourceGro /// /// The name of the subnet. /// - public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) + /// + /// Expands referenced resources. + /// + public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) { - Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete subnet operation deletes the specified subnet. + /// Gets the specified subnet by virtual network and resource group. /// /// /// The operations group for this extension method. @@ -100,16 +102,22 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the subnet. /// + /// + /// Expands referenced resources. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get subnet operation retrieves information about the specified subnet. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -123,16 +131,16 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the subnet. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update subnet operation. /// - public static Subnet Get(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string)) + public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, subnetName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get subnet operation retrieves information about the specified subnet. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -146,23 +154,22 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the subnet. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update subnet operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -173,20 +180,13 @@ public static void BeginDelete(this ISubnetsOperations operations, string resour /// /// The name of the virtual network. /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create/update Subnet operation - /// - public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) + public static IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -197,26 +197,19 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r /// /// The name of the virtual network. /// - /// - /// The name of the subnet. - /// - /// - /// Parameters supplied to the create/update Subnet operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -230,17 +223,13 @@ public static Subnet CreateOrUpdate(this ISubnetsOperations operations, string r /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create/update Subnet operation - /// - public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) + public static void BeginDelete(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put Subnet operation creates/updates a subnet in the specified virtual - /// network + /// Deletes the specified subnet. /// /// /// The operations group for this extension method. @@ -254,22 +243,16 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str /// /// The name of the subnet. /// - /// - /// Parameters supplied to the create/update Subnet operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -280,13 +263,19 @@ public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, str /// /// The name of the virtual network. /// - public static IPage List(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// + public static Subnet BeginCreateOrUpdate(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters) { - return Task.Factory.StartNew(s => ((ISubnetsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((ISubnetsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Creates or updates a subnet in the specified virtual network. /// /// /// The operations group for this extension method. @@ -297,19 +286,25 @@ public static IPage List(this ISubnetsOperations operations, string reso /// /// The name of the virtual network. /// + /// + /// The name of the subnet. + /// + /// + /// Parameters supplied to the create or update subnet operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this ISubnetsOperations operations, string resourceGroupName, string virtualNetworkName, string subnetName, Subnet subnetParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -323,7 +318,7 @@ public static IPage ListNext(this ISubnetsOperations operations, string } /// - /// The List subnets operation retrieves all the subnets in a virtual network. + /// Gets all subnets in a virtual network. /// /// /// The operations group for this extension method. @@ -344,3 +339,4 @@ public static IPage ListNext(this ISubnetsOperations operations, string } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs index b3f6376ef113c..f8551f5188015 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// UsagesOperations operations. @@ -35,13 +33,16 @@ internal partial class UsagesOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal UsagesOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -53,7 +54,7 @@ internal UsagesOperations(NetworkManagementClient client) /// Lists compute usages for a subscription. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// /// /// Headers that will be added to request. @@ -61,6 +62,18 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -77,11 +90,11 @@ internal UsagesOperations(NetworkManagementClient client) throw new ValidationException(ValidationRules.Pattern, "location", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -97,36 +110,36 @@ internal UsagesOperations(NetworkManagementClient client) ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages").ToString(); - _url = _url.Replace("{location}", Uri.EscapeDataString(location)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -143,10 +156,10 @@ internal UsagesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -154,7 +167,7 @@ internal UsagesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -168,14 +181,14 @@ internal UsagesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -210,9 +223,9 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -241,6 +254,18 @@ internal UsagesOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -267,25 +292,25 @@ internal UsagesOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -302,10 +327,10 @@ internal UsagesOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -313,7 +338,7 @@ internal UsagesOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -327,14 +352,14 @@ internal UsagesOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -369,9 +394,9 @@ internal UsagesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -390,3 +415,4 @@ internal UsagesOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs index bae23908bd35f..654690497acf6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/UsagesOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for UsagesOperations. @@ -29,7 +28,7 @@ public static partial class UsagesOperationsExtensions /// The operations group for this extension method. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// public static IPage List(this IUsagesOperations operations, string location) { @@ -43,7 +42,7 @@ public static IPage List(this IUsagesOperations operations, string locati /// The operations group for this extension method. /// /// - /// The location upon which resource usage is queried. + /// The location where resource usage is queried. /// /// /// The cancellation token. @@ -92,3 +91,4 @@ public static IPage ListNext(this IUsagesOperations operations, string ne } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs index ca12649ce5745..2e19fbe5d80ea 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworkGatewayConnectionsOperations operations. @@ -35,13 +33,16 @@ internal partial class VirtualNetworkGatewayConnectionsOperations : IServiceOper /// /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,9 +51,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie public NetworkManagementClient Client { get; private set; } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The name of the resource group. @@ -61,8 +61,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The headers that will be added to request. @@ -75,15 +75,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Send Request AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The name of the resource group. @@ -91,20 +89,28 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network 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 + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -114,19 +120,11 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -139,42 +137,41 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -190,17 +187,11 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -208,7 +199,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -216,20 +207,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -264,27 +255,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -302,9 +275,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } /// - /// The Get VirtualNetworkGatewayConnection operation retrieves information - /// about the specified virtual network gateway connection through Network - /// resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. @@ -313,15 +284,84 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The name of the virtual network gateway connection. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway connection shared key name. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -331,11 +371,11 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -349,40 +389,40 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -399,10 +439,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -410,7 +450,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -424,14 +464,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -453,7 +493,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -466,9 +506,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -486,63 +526,44 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway connection. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway connection. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -554,42 +575,40 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -606,10 +625,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -617,7 +636,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -625,10 +644,23 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -647,13 +679,31 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -662,20 +712,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The headers that will be added to request. @@ -683,31 +733,27 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// - public async Task> SetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginSetSharedKeyWithHttpMessagesAsync( + // Send request + AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// Headers that will be added to request. @@ -715,10 +761,22 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -736,11 +794,11 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { parameters.Validate(); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -755,40 +813,40 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -806,15 +864,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -822,7 +880,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -830,20 +888,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -865,7 +923,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -873,14 +931,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -891,14 +949,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -916,15 +974,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. /// /// /// Headers that will be added to request. @@ -932,10 +988,19 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -945,11 +1010,11 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -963,40 +1028,40 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSharedKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1013,10 +1078,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1024,7 +1089,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1032,22 +1097,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1067,31 +1124,13 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1100,32 +1139,65 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The name of the resource group. /// + /// + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork 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 + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginSetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (virtualNetworkGatewayConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayConnectionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1137,40 +1209,43 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayConnectionName", virtualNetworkGatewayConnectionName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginSetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1186,11 +1261,17 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1198,7 +1279,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1206,20 +1287,20 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 201 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1241,7 +1322,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1249,14 +1330,32 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1276,38 +1375,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The virtual network gateway connection reset shared key Name. - /// - /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ResetSharedKeyWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginResetSharedKeyWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayConnectionName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The name of the resource group. @@ -1316,8 +1385,8 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// Headers that will be added to request. @@ -1325,6 +1394,18 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1346,11 +1427,11 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { parameters.Validate(); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1368,37 +1449,37 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.Enter(_invocationId, this, "BeginResetSharedKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayConnectionName}", Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayConnectionName}", System.Uri.EscapeDataString(virtualNetworkGatewayConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1416,15 +1497,15 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie string _requestContent = null; if(parameters != null) { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1432,7 +1513,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1446,14 +1527,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1488,9 +1569,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1520,6 +1601,18 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1546,25 +1639,25 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1581,10 +1674,10 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1592,7 +1685,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1606,14 +1699,14 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1648,9 +1741,9 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1669,3 +1762,4 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs index 132337bf01905..a27950a0235a4 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewayConnectionsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworkGatewayConnectionsOperations. @@ -23,9 +22,8 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworkGatewayConnectionsOperationsExtensions { /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -37,8 +35,8 @@ public static partial class VirtualNetworkGatewayConnectionsOperationsExtensions /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) { @@ -46,9 +44,8 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -60,8 +57,8 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor /// The name of the virtual network gateway connection. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The cancellation token. @@ -75,9 +72,7 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The operations group for this extension method. @@ -88,19 +83,13 @@ public static VirtualNetworkGatewayConnection CreateOrUpdate(this IVirtualNetwor /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. - /// - public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) + public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnection operation creates/updates a - /// virtual network gateway connection in the specified resource group - /// through Network resource provider. + /// Gets the specified virtual network gateway connection by resource group. /// /// /// The operations group for this extension method. @@ -111,25 +100,19 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN /// /// The name of the virtual network gateway connection. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// connection operation through Network resource provider. - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Get VirtualNetworkGatewayConnection operation retrieves information - /// about the specified virtual network gateway connection through Network - /// resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -140,15 +123,13 @@ public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualN /// /// The name of the virtual network gateway connection. /// - public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetworkGatewayConnection operation retrieves information - /// about the specified virtual network gateway connection through Network - /// resource provider. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -162,17 +143,16 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -181,16 +161,22 @@ public static VirtualNetworkGatewayConnection Get(this IVirtualNetworkGatewayCon /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection name. /// - public static void Delete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. + /// + public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -199,19 +185,27 @@ public static void Delete(this IVirtualNetworkGatewayConnectionsOperations opera /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection name. + /// + /// + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. /// /// /// The operations group for this extension method. @@ -220,16 +214,17 @@ public static void Delete(this IVirtualNetworkGatewayConnectionsOperations opera /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection shared key name. /// - public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGatewayConnection operation deletes the specified - /// virtual network Gateway connection through Network resource provider. + /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + /// information about the specified virtual network gateway connection shared + /// key through Network resource provider. /// /// /// The operations group for this extension method. @@ -238,21 +233,22 @@ public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations /// The name of the resource group. /// /// - /// The name of the virtual network gateway connection. + /// The virtual network gateway connection shared key name. /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// /// /// The operations group for this extension method. @@ -260,23 +256,14 @@ public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations /// /// The name of the resource group. /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// - public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) + public static IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).SetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The List VirtualNetworkGatewayConnections operation retrieves all the + /// virtual network gateways connections created. /// /// /// The operations group for this extension method. @@ -284,29 +271,22 @@ public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnec /// /// The name of the resource group. /// - /// - /// The virtual network gateway connection name. - /// - /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. - /// /// /// The cancellation token. /// - public static async Task SetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.SetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -315,22 +295,22 @@ public static ConnectionSharedKey SetSharedKey(this IVirtualNetworkGatewayConnec /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// - public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) + public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -339,27 +319,26 @@ public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayC /// The name of the resource group. /// /// - /// The virtual network gateway connection name. + /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Set Virtual Network Gateway connection - /// Shared key operation throughNetwork resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The cancellation token. /// - public static async Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -368,17 +347,20 @@ public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayC /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. /// - public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) + /// + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. + /// + public static VirtualNetworkGatewayConnection BeginCreateOrUpdate(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).GetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - /// information about the specified virtual network gateway connection shared - /// key through Network resource provider. + /// Creates or updates a virtual network gateway connection in the specified + /// resource group. /// /// /// The operations group for this extension method. @@ -387,22 +369,25 @@ public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnec /// The name of the resource group. /// /// - /// The virtual network gateway connection shared key name. + /// The name of the virtual network gateway connection. + /// + /// + /// Parameters supplied to the create or update virtual network gateway + /// connection operation. /// /// /// The cancellation token. /// - public static async Task GetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -410,14 +395,16 @@ public static ConnectionSharedKey GetSharedKey(this IVirtualNetworkGatewayConnec /// /// The name of the resource group. /// - public static IPage List(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName) + /// + /// The name of the virtual network gateway connection. + /// + public static void BeginDelete(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List VirtualNetworkGatewayConnections operation retrieves all the - /// virtual network gateways connections created. + /// Deletes the specified virtual network Gateway connection. /// /// /// The operations group for this extension method. @@ -425,22 +412,22 @@ public static IPage List(this IVirtualNetworkGa /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway connection. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, null, cancellationToken).ConfigureAwait(false); } /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -449,22 +436,22 @@ public static IPage List(this IVirtualNetworkGa /// The name of the resource group. /// /// - /// The virtual network gateway connection reset shared key Name. + /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// - public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) + public static ConnectionSharedKey BeginSetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).ResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewayConnectionsOperations)s).BeginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual + /// network gateway connection shared key for passed virtual network gateway + /// connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -473,18 +460,18 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// The name of the resource group. /// /// - /// The virtual network gateway connection reset shared key Name. + /// The virtual network gateway connection name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the Begin Set Virtual Network Gateway connection + /// Shared key operation throughNetwork resource provider. /// /// /// The cancellation token. /// - public static async Task ResetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginSetSharedKeyAsync(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionSharedKey parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ResetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginSetSharedKeyWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -493,8 +480,8 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -506,8 +493,8 @@ public static ConnectionResetSharedKey ResetSharedKey(this IVirtualNetworkGatewa /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkGatewayConnectionsOperations operations, string resourceGroupName, string virtualNetworkGatewayConnectionName, ConnectionResetSharedKey parameters) { @@ -517,8 +504,8 @@ public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkG /// /// The VirtualNetworkGatewayConnectionResetSharedKey operation resets the /// virtual network gateway connection shared key for passed virtual network - /// gateway connection in the specified resource group through Network - /// resource provider. + /// gateway connection in the specified resource group through Network resource + /// provider. /// /// /// The operations group for this extension method. @@ -530,8 +517,8 @@ public static ConnectionResetSharedKey BeginResetSharedKey(this IVirtualNetworkG /// The virtual network gateway connection reset shared key Name. /// /// - /// Parameters supplied to the Begin Reset Virtual Network Gateway connection - /// shared key operation through Network resource provider. + /// Parameters supplied to the begin reset virtual network gateway connection + /// shared key operation through network resource provider. /// /// /// The cancellation token. @@ -582,3 +569,4 @@ public static IPage ListNext(this IVirtualNetwo } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index c4eecd1356fb3..9140fd48454d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworkGatewaysOperations operations. @@ -35,13 +33,16 @@ internal partial class VirtualNetworkGatewaysOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,8 +51,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -60,8 +61,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The headers that will be added to request. @@ -74,14 +74,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Send Request AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( resourceGroupName, virtualNetworkGatewayName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The name of the resource group. @@ -89,20 +88,28 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network 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 + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -112,19 +119,11 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -137,42 +136,41 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -188,17 +186,11 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -206,7 +198,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -214,20 +206,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -262,27 +254,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -300,8 +274,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Get VirtualNetworkGateway operation retrieves information about the - /// specified virtual network gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -310,29 +283,57 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// The name of the virtual network gateway. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + } + + /// + /// Gets all virtual network gateways by resource group. + /// + /// + /// The name of the resource group. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -344,42 +345,40 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -396,10 +395,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -407,7 +406,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -421,14 +420,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -450,7 +449,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -463,9 +462,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -483,8 +482,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -492,23 +491,27 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( + resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The name of the resource group. @@ -516,16 +519,32 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// + /// + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -535,11 +554,19 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (this.Client.ApiVersion == null) + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -552,41 +579,42 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Generatevpnclientpackage", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -602,11 +630,17 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -614,7 +648,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -622,10 +656,23 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -644,13 +691,31 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -659,32 +724,62 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to create or update virtual network gateway operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (virtualNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -696,40 +791,43 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -745,11 +843,17 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -757,7 +861,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -765,20 +869,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -800,7 +904,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -813,9 +917,27 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -833,9 +955,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The name of the resource group. @@ -843,49 +963,25 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> ResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginResetWithHttpMessagesAsync( - resourceGroupName, virtualNetworkGatewayName, gatewayVip, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network gateway. - /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -895,11 +991,11 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -912,46 +1008,41 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("gatewayVip", gatewayVip); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (gatewayVip != null) - { - _queryParameters.Add(string.Format("gatewayVip={0}", Uri.EscapeDataString(gatewayVip))); - } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -968,10 +1059,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -979,7 +1070,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -987,22 +1078,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 204 && (int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1022,31 +1105,13 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1055,9 +1120,8 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The Generatevpnclientpackage operation generates Vpn client package for - /// P2S client of the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The name of the resource group. @@ -1065,9 +1129,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Generating Virtual Network Gateway Vpn - /// client package operation through Network resource provider. + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// Headers that will be added to request. @@ -1075,10 +1139,22 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GeneratevpnclientpackageWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginResetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1088,19 +1164,11 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1113,42 +1181,46 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("gatewayVip", gatewayVip); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Generatevpnclientpackage", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginReset", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (gatewayVip != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("gatewayVip={0}", System.Uri.EscapeDataString(gatewayVip))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1164,17 +1236,11 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1182,7 +1248,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1190,20 +1256,20 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1225,7 +1291,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1233,14 +1299,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1258,8 +1324,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1270,6 +1335,18 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1296,25 +1373,25 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1331,10 +1408,10 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1342,7 +1419,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1356,14 +1433,14 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1398,9 +1475,9 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1419,3 +1496,4 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 7480e0a4eb577..3551911ae292b 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworkGatewaysOperations. @@ -23,8 +22,8 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworkGatewaysOperationsExtensions { /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -36,8 +35,7 @@ public static partial class VirtualNetworkGatewaysOperationsExtensions /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { @@ -45,8 +43,8 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -58,8 +56,7 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO /// The name of the virtual network gateway. /// /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The cancellation token. @@ -73,8 +70,7 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The operations group for this extension method. @@ -85,18 +81,13 @@ public static VirtualNetworkGateway CreateOrUpdate(this IVirtualNetworkGatewaysO /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. - /// - public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) + public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetworkGateway operation creates/updates a virtual network - /// gateway in the specified resource group through Network resource provider. + /// Gets the specified virtual network gateway by resource group. /// /// /// The operations group for this extension method. @@ -107,24 +98,19 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Create or update Virtual Network Gateway - /// operation through Network resource provider. - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Get VirtualNetworkGateway operation retrieves information about the - /// specified virtual network gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -135,14 +121,13 @@ public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGate /// /// The name of the virtual network gateway. /// - public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GetAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetworkGateway operation retrieves information about the - /// specified virtual network gateway through Network resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -156,17 +141,13 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -174,17 +155,13 @@ public static VirtualNetworkGateway Get(this IVirtualNetworkGatewaysOperations o /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway. - /// - public static void Delete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + public static IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).DeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -192,20 +169,20 @@ public static void Delete(this IVirtualNetworkGatewaysOperations operations, str /// /// The name of the resource group. /// - /// - /// The name of the virtual network gateway. - /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -216,14 +193,18 @@ public static void Delete(this IVirtualNetworkGatewaysOperations operations, str /// /// The name of the virtual network gateway. /// - public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// + public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) { - Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetworkGateway operation deletes the specified virtual - /// network Gateway through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -234,17 +215,24 @@ public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations /// /// The name of the virtual network gateway. /// + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The operations group for this extension method. @@ -252,14 +240,21 @@ public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations /// /// The name of the resource group. /// - public static IPage List(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName) + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. + /// + public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Generates VPN client package for P2S client of the virtual network gateway + /// in the specified resource group. /// /// /// The operations group for this extension method. @@ -267,21 +262,27 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the resource group. /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the generate virtual network gateway VPN client + /// package operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -292,19 +293,17 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// + /// Parameters supplied to create or update virtual network gateway operation. /// - public static VirtualNetworkGateway Reset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + public static VirtualNetworkGateway BeginCreateOrUpdate(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).ResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Creates or updates a virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -315,25 +314,22 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. + /// + /// Parameters supplied to create or update virtual network gateway operation. /// /// /// The cancellation token. /// - public static async Task ResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VirtualNetworkGateway parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -344,19 +340,13 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. - /// - public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) + public static void BeginDelete(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Reset VirtualNetworkGateway operation resets the primary of the - /// virtual network gateway in the specified resource group through Network - /// resource provider. + /// Deletes the specified virtual network gateway. /// /// /// The operations group for this extension method. @@ -367,25 +357,17 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Virtual network gateway vip address supplied to the Begin Reset of - /// Active-Active feature enabled Gateway. - /// /// /// The cancellation token. /// - public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false); } /// - /// The Generatevpnclientpackage operation generates Vpn client package for - /// P2S client of the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -396,19 +378,18 @@ public static IPage List(this IVirtualNetworkGatewaysOper /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Generating Virtual Network Gateway Vpn - /// client package operation through Network resource provider. + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// - public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters) + public static VirtualNetworkGateway BeginReset(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string)) { - return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).GeneratevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkGatewaysOperations)s).BeginResetAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Generatevpnclientpackage operation generates Vpn client package for - /// P2S client of the virtual network gateway in the specified resource group - /// through Network resource provider. + /// Resets the primary of the virtual network gateway in the specified resource + /// group. /// /// /// The operations group for this extension method. @@ -419,24 +400,23 @@ public static string Generatevpnclientpackage(this IVirtualNetworkGatewaysOperat /// /// The name of the virtual network gateway. /// - /// - /// Parameters supplied to the Begin Generating Virtual Network Gateway Vpn - /// client package operation through Network resource provider. + /// + /// Virtual network gateway vip address supplied to the begin reset of the + /// active-active feature enabled gateway. /// /// /// The cancellation token. /// - public static async Task GeneratevpnclientpackageAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginResetAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string gatewayVip = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GeneratevpnclientpackageWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginResetWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -450,8 +430,7 @@ public static IPage ListNext(this IVirtualNetworkGateways } /// - /// The List VirtualNetworkGateways operation retrieves all the virtual - /// network gateways stored. + /// Gets all virtual network gateways by resource group. /// /// /// The operations group for this extension method. @@ -472,3 +451,4 @@ public static IPage ListNext(this IVirtualNetworkGateways } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs index da18da393dd6d..9da9312cb37d0 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworkPeeringsOperations operations. @@ -35,13 +33,16 @@ internal partial class VirtualNetworkPeeringsOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -72,11 +73,11 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Gets the specified virtual network peering. /// /// /// The name of the resource group. @@ -93,10 +94,22 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -110,11 +123,11 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -129,41 +142,41 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -180,10 +193,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -191,7 +204,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -199,10 +212,23 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -221,13 +247,31 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -236,8 +280,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } /// - /// The Get virtual network peering operation retrieves information about the - /// specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -246,7 +289,36 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all virtual network peerings in a virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. /// /// /// Headers that will be added to request. @@ -254,10 +326,22 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -267,15 +351,11 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (virtualNetworkPeeringName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -288,43 +368,41 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -341,10 +419,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -352,7 +430,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -366,14 +444,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -395,7 +473,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -408,9 +486,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -428,8 +506,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Deletes the specified virtual network peering. /// /// /// The name of the resource group. @@ -438,42 +515,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering operation + /// The name of the virtual network peering. /// /// /// Headers that will be added to request. @@ -481,10 +523,19 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -498,15 +549,11 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); } - if (virtualNetworkPeeringParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -520,43 +567,42 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); - tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{virtualNetworkPeeringName}", Uri.EscapeDataString(virtualNetworkPeeringName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -572,17 +618,11 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(virtualNetworkPeeringParameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -590,7 +630,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -598,22 +638,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -633,49 +665,13 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -684,8 +680,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The name of the resource group. @@ -693,16 +688,35 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -712,11 +726,19 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (virtualNetworkPeeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringName"); + } + if (virtualNetworkPeeringParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkPeeringParameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -729,41 +751,44 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); + tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -779,11 +804,17 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(virtualNetworkPeeringParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(virtualNetworkPeeringParameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -791,7 +822,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -799,20 +830,20 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -834,7 +865,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -847,9 +878,27 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -867,8 +916,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The NextLink from the previous successful call to List operation. @@ -879,6 +927,18 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -905,25 +965,25 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -940,10 +1000,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -951,7 +1011,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -965,14 +1025,14 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1007,9 +1067,9 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1028,3 +1088,4 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index 82c61ed739f19..dae4cc56d8f26 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworkPeeringsOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworkPeeringsOperationsExtensions { /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -39,11 +38,11 @@ public static partial class VirtualNetworkPeeringsOperationsExtensions /// public static void Delete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -66,7 +65,7 @@ public static void Delete(this IVirtualNetworkPeeringsOperations operations, str } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Gets the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -80,13 +79,13 @@ public static void Delete(this IVirtualNetworkPeeringsOperations operations, str /// /// The name of the virtual network peering. /// - public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The delete virtual network peering operation deletes the specified peering. + /// Gets the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -103,14 +102,16 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get virtual network peering operation retrieves information about the - /// specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -122,16 +123,19 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. /// - public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// + public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).GetAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get virtual network peering operation retrieves information about the - /// specified virtual network peering. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -143,22 +147,25 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// The name of the virtual network. /// /// - /// The name of the virtual network peering. + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -169,20 +176,13 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// /// The name of the virtual network. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering operation - /// - public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) + public static IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -193,26 +193,19 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// /// The name of the virtual network. /// - /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -224,19 +217,15 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering operation + /// The name of the virtual network peering. /// - public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) + public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put virtual network peering operation creates/updates a peering in the - /// specified virtual network + /// Deletes the specified virtual network peering. /// /// /// The operations group for this extension method. @@ -248,25 +237,18 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// The name of the virtual network. /// /// - /// The name of the peering. - /// - /// - /// Parameters supplied to the create/update virtual network peering operation + /// The name of the virtual network peering. /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, null, cancellationToken).ConfigureAwait(false); } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -277,14 +259,20 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// /// The name of the virtual network. /// - public static IPage List(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// + public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).ListAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworkPeeringsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Creates or updates a peering in the specified virtual network. /// /// /// The operations group for this extension method. @@ -295,20 +283,26 @@ public static IPage List(this IVirtualNetworkPeeringsOper /// /// The name of the virtual network. /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update virtual network peering + /// operation. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -322,8 +316,7 @@ public static IPage ListNext(this IVirtualNetworkPeerings } /// - /// The List virtual network peerings operation retrieves all the peerings in - /// a virtual network. + /// Gets all virtual network peerings in a virtual network. /// /// /// The operations group for this extension method. @@ -344,3 +337,4 @@ public static IPage ListNext(this IVirtualNetworkPeerings } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs index dc0e178f35f51..398c0867f0fa1 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperations.cs @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Linq; + using Azure; + using Management; + using Rest; + using 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.Net.Http.Headers; - using System.Text; - using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using Microsoft.Rest.Azure; - using Models; /// /// VirtualNetworksOperations operations. @@ -35,13 +33,16 @@ internal partial class VirtualNetworksOperations : IServiceOperations /// Reference to the service client. /// + /// + /// Thrown when a required parameter is null + /// internal VirtualNetworksOperations(NetworkManagementClient client) { - if (client == null) + if (client == null) { - throw new ArgumentNullException("client"); + throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -50,7 +51,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The name of the resource group. @@ -69,11 +70,11 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( resourceGroupName, virtualNetworkName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Gets the specified virtual network by resource group. /// /// /// The name of the resource group. @@ -81,16 +82,31 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// + /// + /// Expands referenced resources. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -100,11 +116,11 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -117,41 +133,46 @@ internal VirtualNetworksOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -168,10 +189,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -179,7 +200,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -187,10 +208,23 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -209,13 +243,31 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -224,8 +276,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The Get VirtualNetwork operation retrieves information about the specified - /// virtual network. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -233,33 +284,56 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update virtual network operation /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken); + return await Client.GetPutOrPatchOperationResultAsync(_response, + customHeaders, + cancellationToken); + } + + /// + /// Gets all virtual networks in a subscription. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualNetworkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -270,48 +344,39 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); - } - if (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", Uri.EscapeDataString(expand))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -328,10 +393,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -339,7 +404,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -353,14 +418,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -382,7 +447,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -395,9 +460,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -415,75 +480,43 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync( - resourceGroupName, virtualNetworkName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); - } - - /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Gets all virtual networks in a resource group. /// /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -495,43 +528,40 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -547,17 +577,11 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -565,7 +589,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -573,20 +597,20 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -608,7 +632,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -621,27 +645,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -659,24 +665,53 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Checks whether a private IP address is available for use. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListAllWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -687,39 +722,48 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("ipAddress", ipAddress); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAll", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (ipAddress != null) + { + _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); + } + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -736,10 +780,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -747,7 +791,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -761,14 +805,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -790,7 +834,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -803,9 +847,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -823,31 +867,47 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Deletes the specified virtual network. /// /// /// The name of the resource group. /// + /// + /// The name of the virtual network. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -859,40 +919,42 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -909,10 +971,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -920,7 +982,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -928,22 +990,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { + if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } } - catch (JsonException) - { - // Ignore the exception + else { + _responseContent = string.Empty; } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -963,31 +1017,13 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -996,7 +1032,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// Checks whether a private Ip address is available for use. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The name of the resource group. @@ -1004,8 +1040,8 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network operation /// /// /// Headers that will be added to request. @@ -1013,10 +1049,22 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> CheckIPAddressAvailabilityWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1026,11 +1074,15 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); } - if (this.Client.ApiVersion == null) + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } @@ -1041,48 +1093,44 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("ipAddress", ipAddress); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckIPAddressAvailability", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability").ToString(); - _url = _url.Replace("{resourceGroupName}", Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", Uri.EscapeDataString(virtualNetworkName)); - _url = _url.Replace("{subscriptionId}", Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (ipAddress != null) - { - _queryParameters.Add(string.Format("ipAddress={0}", Uri.EscapeDataString(ipAddress))); - } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1098,11 +1146,17 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1110,7 +1164,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1118,20 +1172,20 @@ internal VirtualNetworksOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1153,7 +1207,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1166,9 +1220,27 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1186,7 +1258,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -1197,6 +1269,18 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1223,25 +1307,25 @@ internal VirtualNetworksOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1258,10 +1342,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1269,7 +1353,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1283,14 +1367,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1325,9 +1409,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1345,7 +1429,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -1356,6 +1440,18 @@ internal VirtualNetworksOperations(NetworkManagementClient client) /// /// The cancellation token. /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// @@ -1382,25 +1478,25 @@ internal VirtualNetworksOperations(NetworkManagementClient client) List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - HttpRequestMessage _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new Uri(_url); + 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 (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString()); + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1417,10 +1513,10 @@ internal VirtualNetworksOperations(NetworkManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -1428,7 +1524,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1442,14 +1538,14 @@ internal VirtualNetworksOperations(NetworkManagementClient client) try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } @@ -1484,9 +1580,9 @@ internal VirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) @@ -1505,3 +1601,4 @@ internal VirtualNetworksOperations(NetworkManagementClient client) } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs index 9bbf0cced5677..b57502ff88de6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Generated/VirtualNetworksOperationsExtensions.cs @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0 +// +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Network { - using System; - using System.Collections; - using System.Collections.Generic; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VirtualNetworksOperations. @@ -23,7 +22,7 @@ namespace Microsoft.Azure.Management.Network public static partial class VirtualNetworksOperationsExtensions { /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -36,11 +35,11 @@ public static partial class VirtualNetworksOperationsExtensions /// public static void Delete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) { - Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).DeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -60,7 +59,7 @@ public static void Delete(this IVirtualNetworksOperations operations, string res } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Gets the specified virtual network by resource group. /// /// /// The operations group for this extension method. @@ -71,13 +70,16 @@ public static void Delete(this IVirtualNetworksOperations operations, string res /// /// The name of the virtual network. /// - public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) + /// + /// Expands referenced resources. + /// + public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string)) { - Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).GetAsync(resourceGroupName, virtualNetworkName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Delete VirtualNetwork operation deletes the specified virtual network + /// Gets the specified virtual network by resource group. /// /// /// The operations group for this extension method. @@ -88,17 +90,22 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// /// The name of the virtual network. /// + /// + /// Expands referenced resources. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// The Get VirtualNetwork operation retrieves information about the specified - /// virtual network. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -109,17 +116,16 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// /// The name of the virtual network. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update virtual network operation /// - public static VirtualNetwork Get(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string)) + public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).GetAsync(resourceGroupName, virtualNetworkName, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Get VirtualNetwork operation retrieves information about the specified - /// virtual network. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -130,71 +136,50 @@ public static void BeginDelete(this IVirtualNetworksOperations operations, strin /// /// The name of the virtual network. /// - /// - /// expand references resources. + /// + /// Parameters supplied to the create or update virtual network operation /// /// /// The cancellation token. /// - public static async Task GetAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// - public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) + public static IPage ListAll(this IVirtualNetworksOperations operations) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -202,20 +187,13 @@ public static VirtualNetwork CreateOrUpdate(this IVirtualNetworksOperations oper /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// - public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) + public static IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The Put VirtualNetwork operation creates/updates a virtual network in the - /// specified resource group. + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -223,53 +201,65 @@ public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations /// /// The name of the resource group. /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to the create/update Virtual Network operation - /// /// /// The cancellation token. /// - public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Checks whether a private IP address is available for use. /// /// /// The operations group for this extension method. /// - public static IPage ListAll(this IVirtualNetworksOperations operations) + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// + public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string)) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAllAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Checks whether a private IP address is available for use. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// The private IP address to be verified. + /// /// /// The cancellation token. /// - public static async Task> ListAllAsync(this IVirtualNetworksOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -277,13 +267,16 @@ public static IPage ListAll(this IVirtualNetworksOperations oper /// /// The name of the resource group. /// - public static IPage List(this IVirtualNetworksOperations operations, string resourceGroupName) + /// + /// The name of the virtual network. + /// + public static void BeginDelete(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).ListAsync(resourceGroupName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginDeleteAsync(resourceGroupName, virtualNetworkName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Deletes the specified virtual network. /// /// /// The operations group for this extension method. @@ -291,19 +284,19 @@ public static IPage List(this IVirtualNetworksOperations operati /// /// The name of the resource group. /// + /// + /// The name of the virtual network. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IVirtualNetworksOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, null, cancellationToken).ConfigureAwait(false); } /// - /// Checks whether a private Ip address is available for use. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -314,16 +307,16 @@ public static IPage List(this IVirtualNetworksOperations operati /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network operation /// - public static IPAddressAvailabilityResult CheckIPAddressAvailability(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string)) + public static VirtualNetwork BeginCreateOrUpdate(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters) { - return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).CheckIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return Task.Factory.StartNew(s => ((IVirtualNetworksOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Checks whether a private Ip address is available for use. + /// Creates or updates a virtual network in the specified resource group. /// /// /// The operations group for this extension method. @@ -334,22 +327,22 @@ public static IPage List(this IVirtualNetworksOperations operati /// /// The name of the virtual network. /// - /// - /// The private IP address to be verified. + /// + /// Parameters supplied to the create or update virtual network operation /// /// /// The cancellation token. /// - public static async Task CheckIPAddressAvailabilityAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, string ipAddress = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworksOperations operations, string resourceGroupName, string virtualNetworkName, VirtualNetwork parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckIPAddressAvailabilityWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, ipAddress, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. @@ -363,7 +356,7 @@ public static IPage ListAllNext(this IVirtualNetworksOperations } /// - /// The list VirtualNetwork returns all Virtual Networks in a subscription + /// Gets all virtual networks in a subscription. /// /// /// The operations group for this extension method. @@ -383,7 +376,7 @@ public static IPage ListAllNext(this IVirtualNetworksOperations } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -397,7 +390,7 @@ public static IPage ListNext(this IVirtualNetworksOperations ope } /// - /// The list VirtualNetwork returns all Virtual Networks in a resource group + /// Gets all virtual networks in a resource group. /// /// /// The operations group for this extension method. @@ -418,3 +411,4 @@ public static IPage ListNext(this IVirtualNetworksOperations ope } } + diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs index 1aa9a2b17aa48..ca353e044722e 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/Properties/AssemblyInfo.cs @@ -19,8 +19,8 @@ [assembly: AssemblyTitle("Microsoft Azure Network Management Library")] [assembly: AssemblyDescription("Provides Microsoft Azure Network management functions for managing the Microsoft Azure Network service.")] -[assembly: AssemblyVersion("8.1.0.0")] -[assembly: AssemblyFileVersion("8.1.0.0")] +[assembly: AssemblyVersion("8.1.1.0")] +[assembly: AssemblyFileVersion("8.1.1.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd index 55a47519f62a7..57db5c1952a71 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/generate.cmd @@ -4,9 +4,9 @@ :: @echo off -set autoRestVersion=0.16.0-Nightly20160406 +set autoRestVersion=1.0.0-Nightly20161206 if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/2016-06-01/swagger/network.json" + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/2016-09-01/swagger/network.json" ) else ( set specFile="%1" ) diff --git a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json index bb4114624d1ce..ad74b574849d6 100644 --- a/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json +++ b/src/ResourceManagement/Network/Microsoft.Azure.Management.Network/project.json @@ -1,5 +1,5 @@ { - "version": "8.1.0-preview", + "version": "8.1.1-preview", "description": "Provides management capabilities for Network services.", "authors": [ "Microsoft" ], diff --git a/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json b/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json new file mode 100644 index 0000000000000..aadca267f1802 --- /dev/null +++ b/src/ResourceManagement/Network/Network.Tests/SessionRecords/Networks.Tests.VirtualNetworkTests/VirtualNetworkPeeringTest.json @@ -0,0 +1,1437 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yaz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "807260af-5542-4d58-b432-0c3b1ed87c78" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network\",\r\n \"namespace\": \"Microsoft.Network\",\r\n \"authorization\": {\r\n \"applicationId\": \"2cf9eb86-36b5-49dc-86ae-9a63135dfa8c\",\r\n \"roleDefinitionId\": \"13ba9ab4-19f0-4804-adc4-14ece36cc7a1\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"virtualNetworks\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"publicIPAddresses\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"networkInterfaces\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"loadBalancers\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"networkSecurityGroups\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"routeTables\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"virtualNetworkGateways\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"localNetworkGateways\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"connections\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"applicationGateways\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationResults\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/CheckDnsNameAvailability\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/usages\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"dnsOperationResults\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnsOperationStatuses\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/A\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/AAAA\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/CNAME\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/PTR\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/MX\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/TXT\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"dnszones/SRV\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-04-01\",\r\n \"2015-05-04-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"trafficmanagerprofiles\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-11-01\",\r\n \"2015-04-28-preview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"checkTrafficManagerNameAvailability\",\r\n \"locations\": [\r\n \"global\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-11-01\",\r\n \"2015-04-28-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"expressRouteCircuits\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\",\r\n \"West India\",\r\n \"UK North\",\r\n \"UK South 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ],\r\n \"capabilities\": \"None\"\r\n },\r\n {\r\n \"resourceType\": \"expressRouteServiceProviders\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\",\r\n \"2015-06-15\",\r\n \"2015-05-01-preview\",\r\n \"2014-12-01-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"networkWatchers\",\r\n \"locations\": [\r\n \"West US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"North Central US\",\r\n \"South Central US\",\r\n \"Central US\",\r\n \"East US 2\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Brazil South\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Central India\",\r\n \"South India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK North\",\r\n \"UK South 2\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"UK West\",\r\n \"UK South\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-09-01\",\r\n \"2016-08-01\",\r\n \"2016-07-01\",\r\n \"2016-06-01\",\r\n \"2016-03-30\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:55:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-request-id": [ + "44de402c-868b-42ab-8ce3-42fa29bb6b9c" + ], + "x-ms-correlation-request-id": [ + "44de402c-868b-42ab-8ce3-42fa29bb6b9c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225516Z:44de402c-868b-42ab-8ce3-42fa29bb6b9c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourcegroups/csmrg4533?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlZ3JvdXBzL2NzbXJnNDUzMz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "29" + ], + "x-ms-client-request-id": [ + "1f07c22b-f593-4226-a99a-1f3c73548fb3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533\",\r\n \"name\": \"csmrg4533\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:55:17 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "1f433485-a3b5-479d-95d6-e9d8b3c68daa" + ], + "x-ms-correlation-request-id": [ + "1f433485-a3b5-479d-95d6-e9d8b3c68daa" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225517Z:1f433485-a3b5-479d-95d6-e9d8b3c68daa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"10.0.1.0/24\"\r\n },\r\n \"name\": \"azsmnet6700\"\r\n },\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"10.0.2.0/24\"\r\n },\r\n \"name\": \"azsmnet7820\"\r\n }\r\n ]\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "530" + ], + "x-ms-client-request-id": [ + "8eaa8106-8846-4c80-80b6-74b0104d8516" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"b664c09d-de0b-45e6-913a-6367a710e92a\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"b664c09d-de0b-45e6-913a-6367a710e92a\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"b664c09d-de0b-45e6-913a-6367a710e92a\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1561" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "e9c55f19-519e-4c28-a7c2-38d4c48caf56" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/e9c55f19-519e-4c28-a7c2-38d4c48caf56?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "8d711bdd-73e2-4959-97a3-5ed64f77dd6f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225612Z:8d711bdd-73e2-4959-97a3-5ed64f77dd6f" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/e9c55f19-519e-4c28-a7c2-38d4c48caf56?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvZTljNTVmMTktNTE5ZS00YzI4LWE3YzItMzhkNGM0OGNhZjU2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d9669ead-5286-48f7-a4f0-82ce6396bdf3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14976" + ], + "x-ms-correlation-request-id": [ + "98324149-96f3-4c48-b015-4da7ce14bad6" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225643Z:98324149-96f3-4c48-b015-4da7ce14bad6" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"5b9bfd45-667a-4c89-acb7-80d5ac359722\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2dfc11c5-2c3c-40ef-ba9c-daacd3c957e5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14975" + ], + "x-ms-correlation-request-id": [ + "45e69c8b-6673-44ce-bfc4-48c70d672a2f" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225643Z:45e69c8b-6673-44ce-bfc4-48c70d672a2f" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2a782036-f45a-4ba6-8e37-42d205ddbbd6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"5b9bfd45-667a-4c89-acb7-80d5ac359722\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"5b9bfd45-667a-4c89-acb7-80d5ac359722\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "0e3823c6-f1bd-4726-853e-08d00678deb7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14974" + ], + "x-ms-correlation-request-id": [ + "e976c9ed-1ce7-4b0b-bf7e-8da84ad35500" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225643Z:e976c9ed-1ce7-4b0b-bf7e-8da84ad35500" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0c884c10-f10d-4065-9671-8527bfe88654" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [\r\n {\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:59 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"9bf560dd-fd1d-493a-b093-084fc40d256f\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "f24c3552-92da-4b43-84e3-f2a4dfaf342c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14967" + ], + "x-ms-correlation-request-id": [ + "d856371e-8f48-4f59-b89d-fe37d270d119" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225800Z:d856371e-8f48-4f59-b89d-fe37d270d119" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "139c04a6-a375-48c3-9aa9-d7176fdef242" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet5619\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619\",\r\n \"etag\": \"W/\\\"7541f070-fc74-4917-8d2c-9a1a026df955\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"820b8dc6-b1fe-4b94-a663-a3c7daf3bd39\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\r\n ]\r\n },\r\n \"dhcpOptions\": {\r\n \"dnsServers\": [\r\n \"10.1.1.1\",\r\n \"10.1.2.4\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"7541f070-fc74-4917-8d2c-9a1a026df955\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n },\r\n {\r\n \"name\": \"azsmnet7820\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/subnets/azsmnet7820\",\r\n \"etag\": \"W/\\\"7541f070-fc74-4917-8d2c-9a1a026df955\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.0.2.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"7541f070-fc74-4917-8d2c-9a1a026df955\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "a24ab917-9f2e-4ae3-ab66-ce6402f53027" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14964" + ], + "x-ms-correlation-request-id": [ + "b56ce094-acb3-4bff-8582-e4b2d5cf60ae" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225845Z:b56ce094-acb3-4bff-8582-e4b2d5cf60ae" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQxNDc2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"10.1.1.0/24\"\r\n },\r\n \"name\": \"azsmnet6700\"\r\n }\r\n ]\r\n },\r\n \"location\": \"West US\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "298" + ], + "x-ms-client-request-id": [ + "221fb0fa-a90f-4cca-9e19-5f6f068c224e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet1476\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\",\r\n \"etag\": \"W/\\\"38471c74-ad10-4107-a6cf-10482a466c9e\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"resourceGuid\": \"9c8b9358-5e65-43ae-aa0d-256cf14c3b9b\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"38471c74-ad10-4107-a6cf-10482a466c9e\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"addressPrefix\": \"10.1.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "1018" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:56:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "53c9e2d1-865d-4bc5-9cab-925bf0afb411" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/53c9e2d1-865d-4bc5-9cab-925bf0afb411?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "64410e00-46ab-4a5c-8249-e88f8d99fc7b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225645Z:64410e00-46ab-4a5c-8249-e88f8d99fc7b" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/53c9e2d1-865d-4bc5-9cab-925bf0afb411?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvNTNjOWUyZDEtODY1ZC00YmM1LTljYWItOTI1YmYwYWZiNDExP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "8cf02e1a-833c-475f-be2c-adbaf3cdabd0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14973" + ], + "x-ms-correlation-request-id": [ + "606bbea5-23c9-424c-87c6-6ba87a6e9654" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225715Z:606bbea5-23c9-424c-87c6-6ba87a6e9654" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQxNDc2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet1476\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\",\r\n \"etag\": \"W/\\\"eca180e2-af78-4f85-8d52-dc8e7faa9168\\\"\",\r\n \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"resourceGuid\": \"9c8b9358-5e65-43ae-aa0d-256cf14c3b9b\",\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"name\": \"azsmnet6700\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476/subnets/azsmnet6700\",\r\n \"etag\": \"W/\\\"eca180e2-af78-4f85-8d52-dc8e7faa9168\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"addressPrefix\": \"10.1.1.0/24\",\r\n \"serviceTunnels\": []\r\n }\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": []\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"eca180e2-af78-4f85-8d52-dc8e7faa9168\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b942aa40-3843-4f9c-a47e-533aed1cb432" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14972" + ], + "x-ms-correlation-request-id": [ + "a5f80fec-f4c3-4251-b4da-82d68e982e24" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225715Z:a5f80fec-f4c3-4251-b4da-82d68e982e24" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"allowForwardedTraffic\": true,\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "250" + ], + "x-ms-client-request-id": [ + "15ab3afd-d2ff-4d3b-8781-c33c453cd468" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"239a5f5b-dc36-4126-b808-664d6a3e4352\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "778" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "abbc845f-7549-4105-9ab5-ed3270f676c5" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/abbc845f-7549-4105-9ab5-ed3270f676c5?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "97553415-3325-4bd3-bb54-1aee4915d2ef" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225718Z:97553415-3325-4bd3-bb54-1aee4915d2ef" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/abbc845f-7549-4105-9ab5-ed3270f676c5?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvYWJiYzg0NWYtNzU0OS00MTA1LTlhYjUtZWQzMjcwZjY3NmM1P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "e343e5f2-af4f-46cf-b418-36ee29e3c441" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14971" + ], + "x-ms-correlation-request-id": [ + "cb9fa8fb-e9c6-4205-a6fb-0c4355567ce9" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225749Z:cb9fa8fb-e9c6-4205-a6fb-0c4355567ce9" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"9bf560dd-fd1d-493a-b093-084fc40d256f\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1a14205f-af53-4905-8555-4ddb9c5e9d95" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14970" + ], + "x-ms-correlation-request-id": [ + "1f18e11f-6c76-4e5d-893e-9b00ca65c0be" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225749Z:1f18e11f-6c76-4e5d-893e-9b00ca65c0be" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "89273bc5-d37e-43e1-9222-661033682cfd" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "W/\"9bf560dd-fd1d-493a-b093-084fc40d256f\"" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "1761348f-7721-476d-b656-c59a7c1cf1ad" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14969" + ], + "x-ms-correlation-request-id": [ + "96e58931-a92c-471a-9c5f-694b7a75be31" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225754Z:96e58931-a92c-471a-9c5f-694b7a75be31" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3M/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "10748ab2-8a8c-475b-bc9b-b2864e83a3da" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"peer1\",\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1\",\r\n \"etag\": \"W/\\\"9bf560dd-fd1d-493a-b093-084fc40d256f\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"peeringState\": \"Initiated\",\r\n \"remoteVirtualNetwork\": {\r\n \"id\": \"/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476\"\r\n },\r\n \"allowVirtualNetworkAccess\": true,\r\n \"allowForwardedTraffic\": true,\r\n \"allowGatewayTransit\": false,\r\n \"useRemoteGateways\": false,\r\n \"remoteAddressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.1.0.0/16\"\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:57:55 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "469971fa-e0a2-4cc6-858b-dee15f712ab5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14968" + ], + "x-ms-correlation-request-id": [ + "62efb437-baa8-41cc-bc22-5cb32e70a620" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225756Z:62efb437-baa8-41cc-bc22-5cb32e70a620" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3M/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7551f33d-3c6f-4ddf-aaf9-647f2368c198" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": []\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2e75296d-8100-463c-a2aa-381300abbee2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14965" + ], + "x-ms-correlation-request-id": [ + "a8b6adc3-36fa-4e48-8f6a-05cfe3870eae" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225844Z:a8b6adc3-36fa-4e48-8f6a-05cfe3870eae" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619/virtualNetworkPeerings/peer1?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5L3ZpcnR1YWxOZXR3b3JrUGVlcmluZ3MvcGVlcjE/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7c298764-3ece-42d8-9aa3-e4f0ce789bfd" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operationResults/72f70e8c-36a1-4482-87ea-8576fcf7f823?api-version=2016-09-01" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "72f70e8c-36a1-4482-87ea-8576fcf7f823" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/72f70e8c-36a1-4482-87ea-8576fcf7f823?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "e3b79ea6-0d28-42c8-a64f-5dd40dd17307" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225814Z:e3b79ea6-0d28-42c8-a64f-5dd40dd17307" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/72f70e8c-36a1-4482-87ea-8576fcf7f823?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvNzJmNzBlOGMtMzZhMS00NDgyLTg3ZWEtODU3NmZjZjdmODIzP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "613acbfa-9524-4860-a70f-40d320abb4b6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14966" + ], + "x-ms-correlation-request-id": [ + "4639577d-f112-429d-8ffc-90ce104cc3dd" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225844Z:4639577d-f112-429d-8ffc-90ce104cc3dd" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet5619?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQ1NjE5P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "205a243e-3997-4072-932f-05c563e703ba" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:58:44 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operationResults/bf6e70fe-9654-4caa-ab74-9a2a50cf683c?api-version=2016-09-01" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "bf6e70fe-9654-4caa-ab74-9a2a50cf683c" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/bf6e70fe-9654-4caa-ab74-9a2a50cf683c?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "e9a541d3-7372-4eb9-938e-8e5654557f95" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225845Z:e9a541d3-7372-4eb9-938e-8e5654557f95" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/bf6e70fe-9654-4caa-ab74-9a2a50cf683c?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvYmY2ZTcwZmUtOTY1NC00Y2FhLWFiNzQtOWEyYTUwY2Y2ODNjP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:59:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "eec15753-44de-464d-b1f2-9c11ee4ad296" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-correlation-request-id": [ + "8e2e2b3a-10bc-4767-a4f4-0a10d024c593" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225915Z:8e2e2b3a-10bc-4767-a4f4-0a10d024c593" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/resourceGroups/csmrg4533/providers/Microsoft.Network/virtualNetworks/azsmnet1476?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Jlc291cmNlR3JvdXBzL2NzbXJnNDUzMy9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL2F6c21uZXQxNDc2P2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9284ef82-1c07-4e04-a558-044f1dec9cc3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:59:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operationResults/1e1eff12-10ca-460f-9ff5-098c619eae9b?api-version=2016-09-01" + ], + "Retry-After": [ + "10" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-request-id": [ + "1e1eff12-10ca-460f-9ff5-098c619eae9b" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/1e1eff12-10ca-460f-9ff5-098c619eae9b?api-version=2016-09-01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "5a6825cd-8d0b-4cc8-b458-81969b85abf0" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225915Z:5a6825cd-8d0b-4cc8-b458-81969b85abf0" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/9532a63e-f2eb-4649-bb23-5ed01077ce80/providers/Microsoft.Network/locations/westus/operations/1e1eff12-10ca-460f-9ff5-098c619eae9b?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvOTUzMmE2M2UtZjJlYi00NjQ5LWJiMjMtNWVkMDEwNzdjZTgwL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvbnMvMWUxZWZmMTItMTBjYS00NjBmLTlmZjUtMDk4YzYxOWVhZTliP2FwaS12ZXJzaW9uPTIwMTYtMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Network.NetworkManagementClient/8.1.0-preview" + ] + }, + "ResponseBody": "{\r\n \"status\": \"Succeeded\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 07 Nov 2016 22:59:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "4a458d8a-bff6-4d13-8b2c-301533616440" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14962" + ], + "x-ms-correlation-request-id": [ + "68e5088f-d71b-4352-b3b8-5f4126fa3c40" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20161107T225946Z:68e5088f-d71b-4352-b3b8-5f4126fa3c40" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "VirtualNetworkPeeringTest": [ + "csmrg4533", + "azsmnet5619", + "azsmnet1476", + "azsmnet6700", + "azsmnet7820" + ] + }, + "Variables": { + "SubscriptionId": "9532a63e-f2eb-4649-bb23-5ed01077ce80" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs b/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs index 7eee38e548f37..a4c33a71bc3a5 100644 --- a/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs +++ b/src/ResourceManagement/Network/Network.Tests/Tests/VirtualNetworkTests.cs @@ -214,5 +214,160 @@ public void VirtualNetworkCheckIpAddressAvailabilityTest() networkManagementClient.VirtualNetworks.Delete(resourceGroupName, vnetName); } } + + [Fact] + public void VirtualNetworkPeeringTest() + { + var handler1 = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + var handler2 = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + + var resourcesClient = ResourcesManagementTestUtilities.GetResourceManagementClientWithHandler(context, handler1); + var networkManagementClient = NetworkManagementTestUtilities.GetNetworkManagementClientWithHandler(context, handler2); + + var location = NetworkManagementTestUtilities.GetResourceLocation(resourcesClient, "Microsoft.Network/virtualNetworks"); + + string resourceGroupName = TestUtilities.GenerateName("csmrg"); + resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroupName, + new ResourceGroup + { + Location = location + }); + + string vnet1Name = TestUtilities.GenerateName(); + string vnet2Name = TestUtilities.GenerateName(); + string subnet1Name = TestUtilities.GenerateName(); + string subnet2Name = TestUtilities.GenerateName(); + + var vnet = new VirtualNetwork() + { + Location = location, + + AddressSpace = new AddressSpace() + { + AddressPrefixes = new List() + { + "10.0.0.0/16", + } + }, + DhcpOptions = new DhcpOptions() + { + DnsServers = new List() + { + "10.1.1.1", + "10.1.2.4" + } + }, + Subnets = new List() + { + new Subnet() + { + Name = subnet1Name, + AddressPrefix = "10.0.1.0/24", + }, + new Subnet() + { + Name = subnet2Name, + AddressPrefix = "10.0.2.0/24", + } + } + }; + + // Put Vnet + var putVnetResponse = networkManagementClient.VirtualNetworks.CreateOrUpdate(resourceGroupName, vnet1Name, vnet); + Assert.Equal("Succeeded", putVnetResponse.ProvisioningState); + + // Get Vnet + var getVnetResponse = networkManagementClient.VirtualNetworks.Get(resourceGroupName, vnet1Name); + Assert.Equal(vnet1Name, getVnetResponse.Name); + Assert.NotNull(getVnetResponse.ResourceGuid); + Assert.Equal("Succeeded", getVnetResponse.ProvisioningState); + + // Create vnet2 + var vnet2 = new VirtualNetwork() + { + Location = location, + + AddressSpace = new AddressSpace() + { + AddressPrefixes = new List() + { + "10.1.0.0/16", + } + }, + Subnets = new List() + { + new Subnet() + { + Name = subnet1Name, + AddressPrefix = "10.1.1.0/24", + } + } + }; + + // Put Vnet2 + var putVnet2 = networkManagementClient.VirtualNetworks.CreateOrUpdate(resourceGroupName, vnet2Name, vnet2); + Assert.Equal("Succeeded", putVnet2.ProvisioningState); + + // Create peering object + var peering = new VirtualNetworkPeering() + { + AllowForwardedTraffic = true, + RemoteVirtualNetwork = new Microsoft.Azure.Management.Network.Models.SubResource + { + Id = putVnet2.Id + } + }; + + // Create Peering + networkManagementClient.VirtualNetworkPeerings.CreateOrUpdate(resourceGroupName, vnet1Name, "peer1", peering); + + // Get Peering + var getPeer = networkManagementClient.VirtualNetworkPeerings.Get(resourceGroupName, vnet1Name, "peer1"); + Assert.Equal("peer1", getPeer.Name); + Assert.Equal(true, getPeer.AllowForwardedTraffic); + Assert.Equal(true, getPeer.AllowVirtualNetworkAccess); + Assert.Equal(false, getPeer.AllowGatewayTransit); + Assert.NotNull(getPeer.RemoteVirtualNetwork); + Assert.Equal(putVnet2.Id, getPeer.RemoteVirtualNetwork.Id); + + // List Peering + var listPeer = networkManagementClient.VirtualNetworkPeerings.List(resourceGroupName, vnet1Name).ToList(); + Assert.Equal(1, listPeer.Count); + Assert.Equal("peer1", listPeer[0].Name); + Assert.Equal(true, listPeer[0].AllowForwardedTraffic); + Assert.Equal(true, listPeer[0].AllowVirtualNetworkAccess); + Assert.Equal(false, listPeer[0].AllowGatewayTransit); + Assert.NotNull(listPeer[0].RemoteVirtualNetwork); + Assert.Equal(putVnet2.Id, listPeer[0].RemoteVirtualNetwork.Id); + + // Get peering from GET vnet + var peeringVnet = networkManagementClient.VirtualNetworks.Get(resourceGroupName, vnet1Name); + Assert.Equal(vnet1Name, peeringVnet.Name); + Assert.Equal(1, peeringVnet.VirtualNetworkPeerings.Count()); + Assert.Equal("peer1", peeringVnet.VirtualNetworkPeerings[0].Name); + Assert.Equal(true, peeringVnet.VirtualNetworkPeerings[0].AllowForwardedTraffic); + Assert.Equal(true, peeringVnet.VirtualNetworkPeerings[0].AllowVirtualNetworkAccess); + Assert.Equal(false, peeringVnet.VirtualNetworkPeerings[0].AllowGatewayTransit); + Assert.NotNull(peeringVnet.VirtualNetworkPeerings[0].RemoteVirtualNetwork); + Assert.Equal(putVnet2.Id, peeringVnet.VirtualNetworkPeerings[0].RemoteVirtualNetwork.Id); + + // Delete Peering + networkManagementClient.VirtualNetworkPeerings.Delete(resourceGroupName, vnet1Name, "peer1"); + + listPeer = networkManagementClient.VirtualNetworkPeerings.List(resourceGroupName, vnet1Name).ToList(); + Assert.Equal(0, listPeer.Count); + + peeringVnet = networkManagementClient.VirtualNetworks.Get(resourceGroupName, vnet1Name); + Assert.Equal(vnet1Name, peeringVnet.Name); + Assert.Equal(0, peeringVnet.VirtualNetworkPeerings.Count()); + + // Delete Vnets + networkManagementClient.VirtualNetworks.Delete(resourceGroupName, vnet1Name); + networkManagementClient.VirtualNetworks.Delete(resourceGroupName, vnet2Name); + } + } } } \ No newline at end of file diff --git a/src/ResourceManagement/Network/Network.sln b/src/ResourceManagement/Network/Network.sln index beedfbed0a352..f22ca8c3ad52a 100644 --- a/src/ResourceManagement/Network/Network.sln +++ b/src/ResourceManagement/Network/Network.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Management.Network", "Microsoft.Azure.Management.Network\Microsoft.Azure.Management.Network.xproj", "{4F22B186-DEB4-4B95-BA58-0187F0E32993}" EndProject @@ -11,6 +11,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HttpRecorder", "..\..\TestF EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestFramework", "..\..\TestFramework\Microsoft.Rest.ClientRuntime.Azure.TestFramework\TestFramework.xproj", "{C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime\Microsoft.Rest.ClientRuntime.xproj", "{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure\Microsoft.Rest.ClientRuntime.Azure.xproj", "{D5296EAB-C13E-4A88-9532-BD0677D18EC9}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure.Authentication", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure.Authentication\Microsoft.Rest.ClientRuntime.Azure.Authentication.xproj", "{6319205D-BBFC-4150-BEAE-31B1C9B911DD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +39,18 @@ Global {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.Build.0 = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.Build.0 = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.Build.0 = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE