diff --git a/src/SDKs/Network/AzSdk.RP.props b/src/SDKs/Network/AzSdk.RP.props index 2eca1c6b02e2..d31176fd331e 100644 --- a/src/SDKs/Network/AzSdk.RP.props +++ b/src/SDKs/Network/AzSdk.RP.props @@ -1,7 +1,7 @@ - Compute_2017-03-30;Network_2018-01-01; + Compute_2017-03-30;Network_2018-02-01; $(PackageTags);$(CommonTags);$(AzureApiTag); - + \ No newline at end of file diff --git a/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs index 6504194b7b24..6cc2f4eba015 100644 --- a/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ApplicationGatewaysOperations.cs @@ -116,7 +116,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -778,7 +778,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -954,7 +954,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1130,7 +1130,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1313,7 +1313,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1502,7 +1502,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1689,7 +1689,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1915,7 +1915,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2113,7 +2113,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2286,7 +2286,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2467,7 +2467,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs index 716d0e879796..b676dfe9d7cc 100644 --- a/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ApplicationSecurityGroupsOperations.cs @@ -116,7 +116,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -322,7 +322,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -694,7 +694,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -878,7 +878,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs index 80f88e6470e9..5fdd9d49f4aa 100644 --- a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs @@ -87,7 +87,7 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs b/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs index d0c1f993c246..0732cf7f6e70 100644 --- a/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/BgpServiceCommunitiesOperations.cs @@ -80,7 +80,7 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs index fca9750a3df4..fe5c32ffa19c 100644 --- a/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ConnectionMonitorsOperations.cs @@ -129,7 +129,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -425,7 +425,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -637,7 +637,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -862,7 +862,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1044,7 +1044,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1226,7 +1226,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1411,7 +1411,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs new file mode 100644 index 000000000000..88a912d4454a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperations.cs @@ -0,0 +1,1401 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DdosProtectionPlansOperations operations. + /// + internal partial class DdosProtectionPlansOperations : IServiceOperations, IDdosProtectionPlansOperations + { + /// + /// Initializes a new instance of the DdosProtectionPlansOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DdosProtectionPlansOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// 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 ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets all DDoS protection plans 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Gets all the DDoS protection plans 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update 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 ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ddosProtectionPlanName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ddosProtectionPlanName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ddosProtectionPlanName", ddosProtectionPlanName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ddosProtectionPlanName}", System.Uri.EscapeDataString(ddosProtectionPlanName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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) + { + _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; + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The NextLink from the previous successful call to List 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs new file mode 100644 index 000000000000..f652bac117b6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/DdosProtectionPlansOperationsExtensions.cs @@ -0,0 +1,361 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DdosProtectionPlansOperations. + /// + public static partial class DdosProtectionPlansOperationsExtensions + { + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static void Delete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + operations.DeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static DdosProtectionPlan Get(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + return operations.GetAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + public static DdosProtectionPlan CreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IDdosProtectionPlansOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IDdosProtectionPlansOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IDdosProtectionPlansOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + public static void BeginDelete(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName) + { + operations.BeginDeleteAsync(resourceGroupName, ddosProtectionPlanName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + public static DdosProtectionPlan BeginCreateOrUpdate(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IDdosProtectionPlansOperations operations, string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ddosProtectionPlanName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IDdosProtectionPlansOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IDdosProtectionPlansOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IDdosProtectionPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs index 989d655e1d6a..58209b4aba70 100644 --- a/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/DefaultSecurityRulesOperations.cs @@ -94,7 +94,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index da39ec771969..b691e62b9852 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -127,7 +127,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs new file mode 100644 index 000000000000..36fc25431a47 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -0,0 +1,767 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCircuitConnectionsOperations operations. + /// + internal partial class ExpressRouteCircuitConnectionsOperations : IServiceOperations, IExpressRouteCircuitConnectionsOperations + { + /// + /// Initializes a new instance of the ExpressRouteCircuitConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit 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> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, 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 (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + 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}/connections/{connectionName}").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("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, 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 (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + 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}/connections/{connectionName}").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("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection 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 circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, 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 (connectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); + } + if (expressRouteCircuitConnectionParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteCircuitConnectionParameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("circuitName", circuitName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("connectionName", connectionName); + tracingParameters.Add("expressRouteCircuitConnectionParameters", expressRouteCircuitConnectionParameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + 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}/connections/{connectionName}").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("{connectionName}", System.Uri.EscapeDataString(connectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(expressRouteCircuitConnectionParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(expressRouteCircuitConnectionParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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) + { + _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; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..6877d9495bd0 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitConnectionsOperationsExtensions.cs @@ -0,0 +1,305 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExpressRouteCircuitConnectionsOperations. + /// + public static partial class ExpressRouteCircuitConnectionsOperationsExtensions + { + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// 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 name of the express route circuit connection. + /// + public static void Delete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + operations.DeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// 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 name of the express route circuit connection. + /// + public static ExpressRouteCircuitConnection Get(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + return operations.GetAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + public static ExpressRouteCircuitConnection CreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// 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 name of the express route circuit connection. + /// + public static void BeginDelete(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName) + { + operations.BeginDeleteAsync(resourceGroupName, circuitName, peeringName, connectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Express Route Circuit Connection from the specified + /// express route circuit. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + public static ExpressRouteCircuitConnection BeginCreateOrUpdate(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Express Route Circuit Connection in the specified + /// express route circuits. + /// + /// + /// 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 name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit circuit + /// connection operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCircuitConnectionsOperations operations, string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs index c23f10166e04..f40089d55673 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -126,7 +126,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs index c47efc95f7fb..394a301c2a39 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCircuitsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -448,7 +448,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -649,7 +649,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -838,7 +838,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1016,7 +1016,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1203,7 +1203,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1387,7 +1387,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1613,7 +1613,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1829,7 +1829,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2042,7 +2042,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2255,7 +2255,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs new file mode 100644 index 000000000000..e6c579239cd4 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -0,0 +1,1100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionPeeringsOperations operations. + /// + internal partial class ExpressRouteCrossConnectionPeeringsOperations : IServiceOperations, IExpressRouteCrossConnectionPeeringsOperations + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionPeeringsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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 crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// 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 crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (peeringParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringParameters"); + } + if (peeringParameters != null) + { + peeringParameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("peeringParameters", peeringParameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(peeringParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(peeringParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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) + { + _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; + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs new file mode 100644 index 000000000000..3e315c1d307a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionPeeringsOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExpressRouteCrossConnectionPeeringsOperations. + /// + public static partial class ExpressRouteCrossConnectionPeeringsOperationsExtensions + { + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + public static IPage List(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName) + { + return operations.ListAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static void Delete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + operations.DeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static ExpressRouteCrossConnectionPeering Get(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + return operations.GetAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + public static ExpressRouteCrossConnectionPeering CreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + public static void BeginDelete(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName) + { + operations.BeginDeleteAsync(resourceGroupName, crossConnectionName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + public static ExpressRouteCrossConnectionPeering BeginCreateOrUpdate(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a peering in the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update ExpressRouteCrossConnection + /// peering operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, peeringParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IExpressRouteCrossConnectionPeeringsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs new file mode 100644 index 000000000000..95670f0690f0 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -0,0 +1,2147 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionsOperations operations. + /// + internal partial class ExpressRouteCrossConnectionsOperations : IServiceOperations, IExpressRouteCrossConnectionsOperations + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Retrieves all the ExpressRouteCrossConnections 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Retrieves all the ExpressRouteCrossConnections 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key 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 crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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 crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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 crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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 crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection 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 crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// 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> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (crossConnectionParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionParameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("crossConnectionParameters", crossConnectionParameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(crossConnectionParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(crossConnectionParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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 crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListArpTable", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTableSummary", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// 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 crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (crossConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "crossConnectionName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (devicePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "devicePath"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("crossConnectionName", crossConnectionName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("devicePath", devicePath); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginListRoutesTable", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{crossConnectionName}", System.Uri.EscapeDataString(crossConnectionName)); + _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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The NextLink from the previous successful call to List 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs new file mode 100644 index 000000000000..17bc4f172ef9 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteCrossConnectionsOperationsExtensions.cs @@ -0,0 +1,703 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExpressRouteCrossConnectionsOperations. + /// + public static partial class ExpressRouteCrossConnectionsOperationsExtensions + { + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IExpressRouteCrossConnectionsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IExpressRouteCrossConnectionsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + public static ExpressRouteCrossConnection Get(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName) + { + return operations.GetAsync(resourceGroupName, crossConnectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the circuit). + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, crossConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + public static ExpressRouteCrossConnection CreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + public static ExpressRouteCrossConnection UpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) + { + return operations.UpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + public static ExpressRouteCircuitsArpTableListResult ListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.ListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The cancellation token. + /// + public static async Task ListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult ListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.ListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task ListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult ListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.ListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task ListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + public static ExpressRouteCrossConnection BeginCreateOrUpdate(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, crossConnectionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, crossConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + public static ExpressRouteCrossConnection BeginUpdateTags(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters) + { + return operations.BeginUpdateTagsAsync(resourceGroupName, crossConnectionName, crossConnectionParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates an express route cross connection tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateTagsAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + public static ExpressRouteCircuitsArpTableListResult BeginListArpTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.BeginListArpTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised ARP table associated with the express route + /// cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// The cancellation token. + /// + public static async Task BeginListArpTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListArpTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResult BeginListRoutesTableSummary(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.BeginListRoutesTableSummaryAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the route table summary associated with the express route cross + /// connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task BeginListRoutesTableSummaryAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableSummaryWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + public static ExpressRouteCircuitsRoutesTableListResult BeginListRoutesTable(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath) + { + return operations.BeginListRoutesTableAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).GetAwaiter().GetResult(); + } + + /// + /// Gets the currently advertised routes table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// The cancellation token. + /// + public static async Task BeginListRoutesTableAsync(this IExpressRouteCrossConnectionsOperations operations, string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginListRoutesTableWithHttpMessagesAsync(resourceGroupName, crossConnectionName, peeringName, devicePath, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IExpressRouteCrossConnectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs b/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs index 41597112d234..b2ecad0745fd 100644 --- a/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/ExpressRouteServiceProvidersOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs b/src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs new file mode 100644 index 000000000000..40d3e6001ca5 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IDdosProtectionPlansOperations.cs @@ -0,0 +1,237 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DdosProtectionPlansOperations operations. + /// + public partial interface IDdosProtectionPlansOperations + { + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets information about the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string ddosProtectionPlanName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a DDoS protection plan. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the DDoS protection plan. + /// + /// + /// Parameters supplied to the create or update 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 ddosProtectionPlanName, DdosProtectionPlan parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all DDoS protection plans in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the DDoS protection plans in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs new file mode 100644 index 000000000000..70e21c0b5de5 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCircuitConnectionsOperations.cs @@ -0,0 +1,189 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCircuitConnectionsOperations operations. + /// + public partial interface IExpressRouteCircuitConnectionsOperations + { + /// + /// Deletes the specified Express Route Circuit Connection from the + /// specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified Express Route Circuit Connection from the + /// specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Express Route Circuit Connection in the + /// specified express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// circuit connection 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified Express Route Circuit Connection from the + /// specified express route circuit. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string circuitName, string peeringName, string connectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Express Route Circuit Connection in the + /// specified express route circuits. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the express route circuit. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the express route circuit connection. + /// + /// + /// Parameters supplied to the create or update express route circuit + /// circuit connection 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 circuitName, string peeringName, string connectionName, ExpressRouteCircuitConnection expressRouteCircuitConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs new file mode 100644 index 000000000000..d52ca3ae64c6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionPeeringsOperations.cs @@ -0,0 +1,218 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionPeeringsOperations operations. + /// + public partial interface IExpressRouteCrossConnectionPeeringsOperations + { + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the specified peering for the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a peering in the specified + /// ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update + /// ExpressRouteCrossConnection peering 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified peering from the ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a peering in the specified + /// ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// Parameters supplied to the create or update + /// ExpressRouteCrossConnection peering 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 crossConnectionName, string peeringName, ExpressRouteCrossConnectionPeering peeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all peerings in a specified ExpressRouteCrossConnection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs new file mode 100644 index 000000000000..6d7b926e744d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IExpressRouteCrossConnectionsOperations.cs @@ -0,0 +1,444 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExpressRouteCrossConnectionsOperations operations. + /// + public partial interface IExpressRouteCrossConnectionsOperations + { + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets details about the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group (peering location of the circuit). + /// + /// + /// The name of the ExpressRouteCrossConnection (service key of the + /// circuit). + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised ARP table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// 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> ListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the route table summary associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// 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> ListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised routes table associated with the + /// express route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// 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> ListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the specified ExpressRouteCrossConnection. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// Parameters supplied to the update express route crossConnection + /// 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 crossConnectionName, ExpressRouteCrossConnection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an express route cross connection tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cross connection. + /// + /// + /// Parameters supplied to update express route cross connection tags. + /// + /// + /// 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> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, TagsObject crossConnectionParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised ARP table associated with the express + /// route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device + /// + /// + /// 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> BeginListArpTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the route table summary associated with the express route + /// cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// 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> BeginListRoutesTableSummaryWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the currently advertised routes table associated with the + /// express route cross connection in a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the ExpressRouteCrossConnection. + /// + /// + /// The name of the peering. + /// + /// + /// The path of the device. + /// + /// + /// 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> BeginListRoutesTableWithHttpMessagesAsync(string resourceGroupName, string crossConnectionName, string peeringName, string devicePath, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all the ExpressRouteCrossConnections in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves all the ExpressRouteCrossConnections in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs index 1476f94891a7..c4655c5dc496 100644 --- a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs @@ -79,6 +79,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IApplicationSecurityGroupsOperations ApplicationSecurityGroups { get; } + /// + /// Gets the IDdosProtectionPlansOperations. + /// + IDdosProtectionPlansOperations DdosProtectionPlans { get; } + /// /// Gets the IAvailableEndpointServicesOperations. /// @@ -94,6 +99,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IExpressRouteCircuitPeeringsOperations ExpressRouteCircuitPeerings { get; } + /// + /// Gets the IExpressRouteCircuitConnectionsOperations. + /// + IExpressRouteCircuitConnectionsOperations ExpressRouteCircuitConnections { get; } + /// /// Gets the IExpressRouteCircuitsOperations. /// @@ -104,6 +114,16 @@ public partial interface INetworkManagementClient : System.IDisposable /// IExpressRouteServiceProvidersOperations ExpressRouteServiceProviders { get; } + /// + /// Gets the IExpressRouteCrossConnectionsOperations. + /// + IExpressRouteCrossConnectionsOperations ExpressRouteCrossConnections { get; } + + /// + /// Gets the IExpressRouteCrossConnectionPeeringsOperations. + /// + IExpressRouteCrossConnectionPeeringsOperations ExpressRouteCrossConnectionPeerings { get; } + /// /// Gets the ILoadBalancersOperations. /// diff --git a/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs index 9616d8f83736..88e8b2d6f08b 100644 --- a/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/IVirtualNetworkGatewaysOperations.cs @@ -403,6 +403,66 @@ public partial interface IVirtualNetworkGatewaysOperations /// Task> GetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec + /// policy for P2S client of 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. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of + /// Virtual Network Gateway P2S client operation through Network + /// resource provider. + /// + /// + /// 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> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Get VpnclientIpsecParameters operation retrieves information + /// about the vpnclient ipsec policy for P2S client of virtual network + /// gateway in the specified resource group through Network resource + /// provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// 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> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a xml format representation for vpn device configuration /// script. /// @@ -715,6 +775,66 @@ public partial interface IVirtualNetworkGatewaysOperations /// Task> BeginGetAdvertisedRoutesWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string peer, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec + /// policy for P2S client of 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. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of + /// Virtual Network Gateway P2S client operation through Network + /// resource provider. + /// + /// + /// 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> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The Get VpnclientIpsecParameters operation retrieves information + /// about the vpnclient ipsec policy for P2S client of virtual network + /// gateway in the specified resource group through Network resource + /// provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// 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> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets all virtual network gateways by resource group. /// /// diff --git a/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs index 42ecbe01a098..66dd6eed0d9e 100644 --- a/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/InboundNatRulesOperations.cs @@ -94,7 +94,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -323,7 +323,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -748,7 +748,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs index 1984c949b0ff..f1daed605ecf 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index 64e85f6868aa..8760d0425a85 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs index ceee87ed195e..4e0c8633c7f2 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs index e0f718e86f2b..679368f1731b 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs index 04291f63809c..76b76ed6a828 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancerProbesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs b/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs index c7ce694af70f..5fd2c10bbd08 100644 --- a/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LoadBalancersOperations.cs @@ -119,7 +119,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +726,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs index b87e2621ace8..e6e4c6e2aef7 100644 --- a/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/LocalNetworkGatewaysOperations.cs @@ -127,7 +127,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -568,7 +568,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -791,7 +791,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -981,7 +981,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs b/src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs new file mode 100644 index 000000000000..c0eea9205b43 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/CircuitConnectionStatus.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for CircuitConnectionStatus. + /// + public static class CircuitConnectionStatus + { + public const string Connected = "Connected"; + public const string Connecting = "Connecting"; + public const string Disconnected = "Disconnected"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorQueryResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorQueryResult.cs index 424f0e8f5317..8c41d1199a0a 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorQueryResult.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorQueryResult.cs @@ -33,9 +33,12 @@ public ConnectionMonitorQueryResult() /// Initializes a new instance of the ConnectionMonitorQueryResult /// class. /// + /// Status of connection monitor source. + /// Possible values include: 'Uknown', 'Active', 'Inactive' /// Information about connection states. - public ConnectionMonitorQueryResult(IList states = default(IList)) + public ConnectionMonitorQueryResult(string sourceStatus = default(string), IList states = default(IList)) { + SourceStatus = sourceStatus; States = states; CustomInit(); } @@ -45,6 +48,13 @@ public ConnectionMonitorQueryResult() /// partial void CustomInit(); + /// + /// Gets or sets status of connection monitor source. Possible values + /// include: 'Uknown', 'Active', 'Inactive' + /// + [JsonProperty(PropertyName = "sourceStatus")] + public string SourceStatus { get; set; } + /// /// Gets or sets information about connection states. /// diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorSourceStatus.cs b/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorSourceStatus.cs new file mode 100644 index 000000000000..e63dbd92278a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ConnectionMonitorSourceStatus.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for ConnectionMonitorSourceStatus. + /// + public static class ConnectionMonitorSourceStatus + { + public const string Uknown = "Uknown"; + public const string Active = "Active"; + public const string Inactive = "Inactive"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ConnectivityParameters.cs b/src/SDKs/Network/Management.Network/Generated/Models/ConnectivityParameters.cs index 91d0748a19fd..48f7043f0016 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ConnectivityParameters.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ConnectivityParameters.cs @@ -30,10 +30,14 @@ public ConnectivityParameters() /// /// Initializes a new instance of the ConnectivityParameters class. /// - public ConnectivityParameters(ConnectivitySource source, ConnectivityDestination destination) + /// Network protocol. Possible values include: + /// 'Tcp', 'Http', 'Https', 'Icmp' + public ConnectivityParameters(ConnectivitySource source, ConnectivityDestination destination, string protocol = default(string), ProtocolConfiguration protocolConfiguration = default(ProtocolConfiguration)) { Source = source; Destination = destination; + Protocol = protocol; + ProtocolConfiguration = protocolConfiguration; CustomInit(); } @@ -52,6 +56,18 @@ public ConnectivityParameters(ConnectivitySource source, ConnectivityDestination [JsonProperty(PropertyName = "destination")] public ConnectivityDestination Destination { get; set; } + /// + /// Gets or sets network protocol. Possible values include: 'Tcp', + /// 'Http', 'Https', 'Icmp' + /// + [JsonProperty(PropertyName = "protocol")] + public string Protocol { get; set; } + + /// + /// + [JsonProperty(PropertyName = "protocolConfiguration")] + public ProtocolConfiguration ProtocolConfiguration { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs b/src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs new file mode 100644 index 000000000000..3961d284cb2f --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/DdosProtectionPlan.cs @@ -0,0 +1,101 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A DDoS protection plan in a resource group. + /// + [Rest.Serialization.JsonTransformation] + public partial class DdosProtectionPlan : Resource + { + /// + /// Initializes a new instance of the DdosProtectionPlan class. + /// + public DdosProtectionPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DdosProtectionPlan class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The resource GUID property of the DDoS + /// protection plan resource. It uniquely identifies the resource, even + /// if the user changes its name or migrate the resource across + /// subscriptions or resource groups. + /// The provisioning state of the DDoS + /// protection plan resource. Possible values are: 'Succeeded', + /// 'Updating', 'Deleting', and 'Failed'. + /// The list of virtual networks + /// associated with the DDoS protection plan resource. This list is + /// read-only. + /// A unique read-only string that changes whenever + /// the resource is updated. + public DdosProtectionPlan(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string resourceGuid = default(string), string provisioningState = default(string), IList virtualNetworks = default(IList), string etag = default(string)) + : base(id, name, type, location, tags) + { + ResourceGuid = resourceGuid; + ProvisioningState = provisioningState; + VirtualNetworks = virtualNetworks; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource GUID property of the DDoS protection plan + /// resource. It uniquely identifies the resource, even if the user + /// changes its name or migrate the resource across subscriptions or + /// resource groups. + /// + [JsonProperty(PropertyName = "properties.resourceGuid")] + public string ResourceGuid { get; private set; } + + /// + /// Gets the provisioning state of the DDoS protection plan resource. + /// Possible values are: 'Succeeded', 'Updating', 'Deleting', and + /// 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets the list of virtual networks associated with the DDoS + /// protection plan resource. This list is read-only. + /// + [JsonProperty(PropertyName = "properties.virtualNetworks")] + public IList VirtualNetworks { get; private set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs new file mode 100644 index 000000000000..426291ec728d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitConnection.cs @@ -0,0 +1,137 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Express Route Circuit Connection in an ExpressRouteCircuitPeering + /// resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteCircuitConnection : SubResource + { + /// + /// Initializes a new instance of the ExpressRouteCircuitConnection + /// class. + /// + public ExpressRouteCircuitConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitConnection + /// class. + /// + /// Resource ID. + /// Reference to Express Route + /// Circuit Private Peering Resource of the circuit initiating + /// connection. + /// Reference to Express + /// Route Circuit Private Peering Resource of the peered + /// circuit. + /// /29 IP address space to carve out + /// Customer addresses for tunnels. + /// The authorization key. + /// Express Route Circuit + /// Connection State. Possible values are: 'Connected' and + /// 'Disconnected'. Possible values include: 'Connected', 'Connecting', + /// 'Disconnected' + /// Provisioning state of the circuit + /// connection resource. Possible values are: 'Succeded', '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 ExpressRouteCircuitConnection(string id = default(string), SubResource expressRouteCircuitPeering = default(SubResource), SubResource peerExpressRouteCircuitPeering = default(SubResource), string addressPrefix = default(string), string authorizationKey = default(string), string circuitConnectionStatus = default(string), string provisioningState = default(string), string name = default(string), string etag = default(string)) + : base(id) + { + ExpressRouteCircuitPeering = expressRouteCircuitPeering; + PeerExpressRouteCircuitPeering = peerExpressRouteCircuitPeering; + AddressPrefix = addressPrefix; + AuthorizationKey = authorizationKey; + CircuitConnectionStatus = circuitConnectionStatus; + ProvisioningState = provisioningState; + Name = name; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets reference to Express Route Circuit Private Peering + /// Resource of the circuit initiating connection. + /// + [JsonProperty(PropertyName = "properties.expressRouteCircuitPeering")] + public SubResource ExpressRouteCircuitPeering { get; set; } + + /// + /// Gets or sets reference to Express Route Circuit Private Peering + /// Resource of the peered circuit. + /// + [JsonProperty(PropertyName = "properties.peerExpressRouteCircuitPeering")] + public SubResource PeerExpressRouteCircuitPeering { get; set; } + + /// + /// Gets or sets /29 IP address space to carve out Customer addresses + /// for tunnels. + /// + [JsonProperty(PropertyName = "properties.addressPrefix")] + public string AddressPrefix { get; set; } + + /// + /// Gets or sets the authorization key. + /// + [JsonProperty(PropertyName = "properties.authorizationKey")] + public string AuthorizationKey { get; set; } + + /// + /// Gets express Route Circuit Connection State. Possible values are: + /// 'Connected' and 'Disconnected'. Possible values include: + /// 'Connected', 'Connecting', 'Disconnected' + /// + [JsonProperty(PropertyName = "properties.circuitConnectionStatus")] + public string CircuitConnectionStatus { get; private set; } + + /// + /// Gets provisioning state of the circuit connection resource. + /// Possible values are: 'Succeded', 'Updating', 'Deleting', and + /// 'Failed'. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets 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; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs index ce1c2f53f723..ae1568ed8aa0 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeering.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Network.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -33,13 +35,11 @@ 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 'Enabled'. Possible values include: 'Disabled', - /// 'Enabled' + /// The peering type. Possible values + /// include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + /// The peering state. Possible values include: + /// 'Disabled', 'Enabled' /// The Azure ASN. /// The peer ASN. /// The primary address @@ -63,12 +63,14 @@ public ExpressRouteCircuitPeering() /// resource. /// The IPv6 peering /// configuration. + /// The list of circuit connections + /// associated with Azure Private Peering for this circuit. /// 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?), long? peerASN = default(long?), 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), RouteFilter routeFilter = default(RouteFilter), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), string name = default(string), string etag = default(string)) + public ExpressRouteCircuitPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), 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), RouteFilter routeFilter = default(RouteFilter), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), IList connections = default(IList), string name = default(string), string etag = default(string)) : base(id) { PeeringType = peeringType; @@ -88,6 +90,7 @@ public ExpressRouteCircuitPeering() LastModifiedBy = lastModifiedBy; RouteFilter = routeFilter; Ipv6PeeringConfig = ipv6PeeringConfig; + Connections = connections; Name = name; Etag = etag; CustomInit(); @@ -99,17 +102,15 @@ public ExpressRouteCircuitPeering() partial void CustomInit(); /// - /// Gets or sets the PeeringType. Possible values are: - /// 'AzurePublicPeering', 'AzurePrivatePeering', and - /// 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', - /// 'AzurePrivatePeering', 'MicrosoftPeering' + /// Gets or sets the peering type. Possible values include: + /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' /// [JsonProperty(PropertyName = "properties.peeringType")] public string PeeringType { get; set; } /// - /// Gets or sets the state of peering. Possible values are: 'Disabled' - /// and 'Enabled'. Possible values include: 'Disabled', 'Enabled' + /// Gets or sets the peering state. Possible values include: + /// 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "properties.state")] public string State { get; set; } @@ -206,6 +207,13 @@ public ExpressRouteCircuitPeering() [JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig { get; set; } + /// + /// Gets or sets the list of circuit connections associated with Azure + /// Private Peering for this circuit. + /// + [JsonProperty(PropertyName = "properties.connections")] + public IList Connections { get; set; } + /// /// Gets name of the resource that is unique within a resource group. /// This name can be used to access the resource. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs new file mode 100644 index 000000000000..83465464334a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitReference.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class ExpressRouteCircuitReference + { + /// + /// Initializes a new instance of the ExpressRouteCircuitReference + /// class. + /// + public ExpressRouteCircuitReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCircuitReference + /// class. + /// + /// Corresponding Express Route Circuit Id. + public ExpressRouteCircuitReference(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets corresponding Express Route Circuit Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs new file mode 100644 index 000000000000..fd1aa4c1d94f --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnection.cs @@ -0,0 +1,162 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// ExpressRouteCrossConnection resource + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteCrossConnection : Resource + { + /// + /// Initializes a new instance of the ExpressRouteCrossConnection + /// class. + /// + public ExpressRouteCrossConnection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExpressRouteCrossConnection + /// class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// The name of the primary + /// port. + /// The name of the secondary + /// port. + /// The identifier of the circuit traffic. + /// The peering location of the + /// ExpressRoute circuit. + /// The circuit bandwidth In + /// Mbps. + /// The ExpressRouteCircuit + /// The provisioning + /// state of the circuit in the connectivity provider system. Possible + /// values are 'NotProvisioned', 'Provisioning', 'Provisioned'. + /// Possible values include: 'NotProvisioned', 'Provisioning', + /// 'Provisioned', 'Deprovisioning' + /// Additional read only notes set + /// by the connectivity provider. + /// Gets the provisioning state of the + /// public IP resource. Possible values are: 'Updating', 'Deleting', + /// and 'Failed'. + /// The list of peerings. + /// Gets a unique read-only string that changes + /// whenever the resource is updated. + public ExpressRouteCrossConnection(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string primaryAzurePort = default(string), string secondaryAzurePort = default(string), int? sTag = default(int?), string peeringLocation = default(string), int? bandwidthInMbps = default(int?), ExpressRouteCircuitReference expressRouteCircuit = default(ExpressRouteCircuitReference), string serviceProviderProvisioningState = default(string), string serviceProviderNotes = default(string), string provisioningState = default(string), IList peerings = default(IList), string etag = default(string)) + : base(id, name, type, location, tags) + { + PrimaryAzurePort = primaryAzurePort; + SecondaryAzurePort = secondaryAzurePort; + STag = sTag; + PeeringLocation = peeringLocation; + BandwidthInMbps = bandwidthInMbps; + ExpressRouteCircuit = expressRouteCircuit; + ServiceProviderProvisioningState = serviceProviderProvisioningState; + ServiceProviderNotes = serviceProviderNotes; + ProvisioningState = provisioningState; + Peerings = peerings; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the primary port. + /// + [JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort { get; private set; } + + /// + /// Gets the name of the secondary port. + /// + [JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort { get; private set; } + + /// + /// Gets the identifier of the circuit traffic. + /// + [JsonProperty(PropertyName = "properties.sTag")] + public int? STag { get; private set; } + + /// + /// Gets the peering location of the ExpressRoute circuit. + /// + [JsonProperty(PropertyName = "properties.peeringLocation")] + public string PeeringLocation { get; private set; } + + /// + /// Gets the circuit bandwidth In Mbps. + /// + [JsonProperty(PropertyName = "properties.bandwidthInMbps")] + public int? BandwidthInMbps { get; private set; } + + /// + /// Gets the ExpressRouteCircuit + /// + [JsonProperty(PropertyName = "properties.expressRouteCircuit")] + public ExpressRouteCircuitReference ExpressRouteCircuit { get; private set; } + + /// + /// Gets or sets the provisioning state of the circuit in the + /// connectivity provider system. Possible values are 'NotProvisioned', + /// 'Provisioning', 'Provisioned'. Possible values include: + /// 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' + /// + [JsonProperty(PropertyName = "properties.serviceProviderProvisioningState")] + public string ServiceProviderProvisioningState { get; set; } + + /// + /// Gets or sets additional read only notes set by the connectivity + /// provider. + /// + [JsonProperty(PropertyName = "properties.serviceProviderNotes")] + public string ServiceProviderNotes { get; set; } + + /// + /// 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; } + + /// + /// Gets or sets the list of peerings. + /// + [JsonProperty(PropertyName = "properties.peerings")] + public IList Peerings { get; set; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs new file mode 100644 index 000000000000..20b47edbfed6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionPeering.cs @@ -0,0 +1,222 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Peering in an ExpressRoute Cross Connection resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ExpressRouteCrossConnectionPeering : SubResource + { + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionPeering class. + /// + public ExpressRouteCrossConnectionPeering() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionPeering class. + /// + /// Resource ID. + /// The peering type. Possible values + /// include: 'AzurePublicPeering', 'AzurePrivatePeering', + /// 'MicrosoftPeering' + /// The peering state. 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 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. + /// The IPv6 peering + /// configuration. + /// 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 ExpressRouteCrossConnectionPeering(string id = default(string), string peeringType = default(string), string state = default(string), int? azureASN = default(int?), long? peerASN = default(long?), 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), string provisioningState = default(string), string gatewayManagerEtag = default(string), string lastModifiedBy = default(string), Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig = default(Ipv6ExpressRouteCircuitPeeringConfig), string name = default(string), string etag = default(string)) + : base(id) + { + PeeringType = peeringType; + State = state; + AzureASN = azureASN; + PeerASN = peerASN; + PrimaryPeerAddressPrefix = primaryPeerAddressPrefix; + SecondaryPeerAddressPrefix = secondaryPeerAddressPrefix; + PrimaryAzurePort = primaryAzurePort; + SecondaryAzurePort = secondaryAzurePort; + SharedKey = sharedKey; + VlanId = vlanId; + MicrosoftPeeringConfig = microsoftPeeringConfig; + ProvisioningState = provisioningState; + GatewayManagerEtag = gatewayManagerEtag; + LastModifiedBy = lastModifiedBy; + Ipv6PeeringConfig = ipv6PeeringConfig; + Name = name; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the peering type. Possible values include: + /// 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' + /// + [JsonProperty(PropertyName = "properties.peeringType")] + public string PeeringType { get; set; } + + /// + /// Gets or sets the peering state. Possible values include: + /// 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; set; } + + /// + /// Gets the Azure ASN. + /// + [JsonProperty(PropertyName = "properties.azureASN")] + public int? AzureASN { get; private set; } + + /// + /// Gets or sets the peer ASN. + /// + [JsonProperty(PropertyName = "properties.peerASN")] + public long? PeerASN { get; set; } + + /// + /// Gets or sets the primary address prefix. + /// + [JsonProperty(PropertyName = "properties.primaryPeerAddressPrefix")] + public string PrimaryPeerAddressPrefix { get; set; } + + /// + /// Gets or sets the secondary address prefix. + /// + [JsonProperty(PropertyName = "properties.secondaryPeerAddressPrefix")] + public string SecondaryPeerAddressPrefix { get; set; } + + /// + /// Gets the primary port. + /// + [JsonProperty(PropertyName = "properties.primaryAzurePort")] + public string PrimaryAzurePort { get; private set; } + + /// + /// Gets the secondary port. + /// + [JsonProperty(PropertyName = "properties.secondaryAzurePort")] + public string SecondaryAzurePort { get; private set; } + + /// + /// Gets or sets the shared key. + /// + [JsonProperty(PropertyName = "properties.sharedKey")] + public string SharedKey { get; set; } + + /// + /// Gets or sets the VLAN ID. + /// + [JsonProperty(PropertyName = "properties.vlanId")] + public int? VlanId { get; set; } + + /// + /// Gets or sets the Microsoft peering configuration. + /// + [JsonProperty(PropertyName = "properties.microsoftPeeringConfig")] + public ExpressRouteCircuitPeeringConfig MicrosoftPeeringConfig { get; set; } + + /// + /// 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; } + + /// + /// Gets the GatewayManager Etag. + /// + [JsonProperty(PropertyName = "properties.gatewayManagerEtag")] + public string GatewayManagerEtag { get; private set; } + + /// + /// Gets whether the provider or the customer last modified the + /// peering. + /// + [JsonProperty(PropertyName = "properties.lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the IPv6 peering configuration. + /// + [JsonProperty(PropertyName = "properties.ipv6PeeringConfig")] + public Ipv6ExpressRouteCircuitPeeringConfig Ipv6PeeringConfig { get; set; } + + /// + /// Gets 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; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PeerASN > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); + } + if (PeerASN < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs new file mode 100644 index 000000000000..f7ceb609a563 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionRoutesTableSummary.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The routes table associated with the ExpressRouteCircuit. + /// + public partial class ExpressRouteCrossConnectionRoutesTableSummary + { + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionRoutesTableSummary class. + /// + public ExpressRouteCrossConnectionRoutesTableSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionRoutesTableSummary class. + /// + /// IP address of Neighbor router + /// 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 ExpressRouteCrossConnectionRoutesTableSummary(string neighbor = default(string), int? asn = default(int?), string upDown = default(string), string stateOrPrefixesReceived = default(string)) + { + Neighbor = neighbor; + Asn = asn; + UpDown = upDown; + StateOrPrefixesReceived = stateOrPrefixesReceived; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets IP address of Neighbor router + /// + [JsonProperty(PropertyName = "neighbor")] + public string Neighbor { get; set; } + + /// + /// Gets or sets autonomous system number. + /// + [JsonProperty(PropertyName = "asn")] + public int? Asn { get; set; } + + /// + /// 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; } + + /// + /// 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 = "stateOrPrefixesReceived")] + public string StateOrPrefixesReceived { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs new file mode 100644 index 000000000000..606abbf9bc27 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Response for ListRoutesTable associated with the Express Route Cross + /// Connections. + /// + public partial class ExpressRouteCrossConnectionsRoutesTableSummaryListResult + { + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + /// + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. + /// + /// A list of the routes table. + /// The URL to get the next set of + /// results. + public ExpressRouteCrossConnectionsRoutesTableSummaryListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// 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. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs new file mode 100644 index 000000000000..2f58bbd4e777 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringState.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for ExpressRoutePeeringState. + /// + public static class ExpressRoutePeeringState + { + public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringType.cs similarity index 85% rename from src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs rename to src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringType.cs index 253e4eab5c24..f621f7015bc9 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/ExpressRouteCircuitPeeringType.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/ExpressRoutePeeringType.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for ExpressRouteCircuitPeeringType. + /// Defines values for ExpressRoutePeeringType. /// - public static class ExpressRouteCircuitPeeringType + public static class ExpressRoutePeeringType { public const string AzurePublicPeering = "AzurePublicPeering"; public const string AzurePrivatePeering = "AzurePrivatePeering"; diff --git a/src/SDKs/Network/Management.Network/Generated/Models/HTTPConfiguration.cs b/src/SDKs/Network/Management.Network/Generated/Models/HTTPConfiguration.cs new file mode 100644 index 000000000000..e0fcef0e8b7d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/HTTPConfiguration.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// HTTP configuration of the connectivity check. + /// + public partial class HTTPConfiguration + { + /// + /// Initializes a new instance of the HTTPConfiguration class. + /// + public HTTPConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HTTPConfiguration class. + /// + /// HTTP method. Possible values include: + /// 'Get' + /// List of HTTP headers. + /// Valid status codes. + public HTTPConfiguration(string method = default(string), IList headers = default(IList), IList validStatusCodes = default(IList)) + { + Method = method; + Headers = headers; + ValidStatusCodes = validStatusCodes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets HTTP method. Possible values include: 'Get' + /// + [JsonProperty(PropertyName = "method")] + public string Method { get; set; } + + /// + /// Gets or sets list of HTTP headers. + /// + [JsonProperty(PropertyName = "headers")] + public IList Headers { get; set; } + + /// + /// Gets or sets valid status codes. + /// + [JsonProperty(PropertyName = "validStatusCodes")] + public IList ValidStatusCodes { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/HTTPHeader.cs b/src/SDKs/Network/Management.Network/Generated/Models/HTTPHeader.cs new file mode 100644 index 000000000000..fcfe02e2f577 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/HTTPHeader.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the HTTP header. + /// + public partial class HTTPHeader + { + /// + /// Initializes a new instance of the HTTPHeader class. + /// + public HTTPHeader() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HTTPHeader class. + /// + /// The name in HTTP header. + /// The value in HTTP header. + public HTTPHeader(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name in HTTP header. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the value in HTTP header. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/HTTPMethod.cs b/src/SDKs/Network/Management.Network/Generated/Models/HTTPMethod.cs new file mode 100644 index 000000000000..5247c370e25d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/HTTPMethod.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for HTTPMethod. + /// + public static class HTTPMethod + { + public const string Get = "Get"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs b/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs index c1556b38a424..0ba8cd89d0ec 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IkeEncryption.cs @@ -21,5 +21,7 @@ public static class IkeEncryption public const string AES128 = "AES128"; public const string AES192 = "AES192"; public const string AES256 = "AES256"; + public const string GCMAES256 = "GCMAES256"; + public const string GCMAES128 = "GCMAES128"; } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IkeIntegrity.cs b/src/SDKs/Network/Management.Network/Generated/Models/IkeIntegrity.cs index 7dd5d7c43a50..a2987970a876 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IkeIntegrity.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IkeIntegrity.cs @@ -20,5 +20,7 @@ public static class IkeIntegrity public const string SHA1 = "SHA1"; public const string SHA256 = "SHA256"; public const string SHA384 = "SHA384"; + public const string GCMAES256 = "GCMAES256"; + public const string GCMAES128 = "GCMAES128"; } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IpFlowProtocol.cs b/src/SDKs/Network/Management.Network/Generated/Models/IpFlowProtocol.cs new file mode 100644 index 000000000000..a591a33afa22 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/IpFlowProtocol.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + + /// + /// Defines values for IpFlowProtocol. + /// + public static class IpFlowProtocol + { + public const string TCP = "TCP"; + public const string UDP = "UDP"; + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs b/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs index ad1faf4f61c4..c1cf4edf0ba8 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/IpsecPolicy.cs @@ -44,16 +44,16 @@ public IpsecPolicy() /// 'GCMAES128', 'GCMAES192', 'GCMAES256' /// The IKE encryption algorithm (IKE phase /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', - /// 'AES256' + /// 'AES256', 'GCMAES256', 'GCMAES128' /// The IKE integrity algorithm (IKE phase - /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - /// 'SHA384' + /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', + /// 'GCMAES256', 'GCMAES128' /// The DH Groups used in IKE Phase 1 for initial /// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - /// The DH Groups used in IKE Phase 2 for new + /// The Pfs Groups used in IKE Phase 2 for new /// child SA. Possible values include: 'None', 'PFS1', 'PFS2', - /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24' + /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup) { SaLifeTimeSeconds = saLifeTimeSeconds; @@ -104,14 +104,16 @@ public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecE /// /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible - /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + /// 'GCMAES256', 'GCMAES128' /// [JsonProperty(PropertyName = "ikeEncryption")] public string IkeEncryption { get; set; } /// /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible - /// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + /// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + /// 'GCMAES128' /// [JsonProperty(PropertyName = "ikeIntegrity")] public string IkeIntegrity { get; set; } @@ -125,9 +127,9 @@ public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecE public string DhGroup { get; set; } /// - /// Gets or sets the DH Groups used in IKE Phase 2 for new child SA. + /// Gets or sets the Pfs Groups used in IKE Phase 2 for new child SA. /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', - /// 'ECP256', 'ECP384', 'PFS24' + /// 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' /// [JsonProperty(PropertyName = "pfsGroup")] public string PfsGroup { get; set; } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs b/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs index 1c9ae1a6267f..f57d2fc2ead6 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/PfsGroup.cs @@ -23,5 +23,7 @@ public static class PfsGroup public const string ECP256 = "ECP256"; public const string ECP384 = "ECP384"; public const string PFS24 = "PFS24"; + public const string PFS14 = "PFS14"; + public const string PFSMM = "PFSMM"; } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/Protocol.cs b/src/SDKs/Network/Management.Network/Generated/Models/Protocol.cs index 0757e6c04d44..d13b5a3bfb13 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/Protocol.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/Protocol.cs @@ -16,7 +16,9 @@ namespace Microsoft.Azure.Management.Network.Models /// public static class Protocol { - public const string TCP = "TCP"; - public const string UDP = "UDP"; + public const string Tcp = "Tcp"; + public const string Http = "Http"; + public const string Https = "Https"; + public const string Icmp = "Icmp"; } } diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ProtocolConfiguration.cs b/src/SDKs/Network/Management.Network/Generated/Models/ProtocolConfiguration.cs new file mode 100644 index 000000000000..67aa70052ef6 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ProtocolConfiguration.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Configuration of the protocol. + /// + public partial class ProtocolConfiguration + { + /// + /// Initializes a new instance of the ProtocolConfiguration class. + /// + public ProtocolConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtocolConfiguration class. + /// + public ProtocolConfiguration(HTTPConfiguration hTTPConfiguration = default(HTTPConfiguration)) + { + HTTPConfiguration = hTTPConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "HTTPConfiguration")] + public HTTPConfiguration HTTPConfiguration { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs index 8e46f7c9d628..a7088832da19 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VirtualNetwork.cs @@ -54,13 +54,16 @@ public VirtualNetwork() /// PublicIP resource. Possible values are: 'Updating', 'Deleting', and /// 'Failed'. /// Indicates if DDoS protection is - /// enabled for all the protected resources in a Virtual - /// Network. - /// Indicates if Vm protection is - /// enabled for all the subnets in a Virtual Network. + /// enabled for all the protected resources in the virtual network. It + /// requires a DDoS protection plan associated with the + /// resource. + /// Indicates if VM protection is + /// enabled for all the subnets in the virtual network. + /// The DDoS protection plan + /// associated with the virtual network. /// 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), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), string etag = default(string)) + 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), bool? enableDdosProtection = default(bool?), bool? enableVmProtection = default(bool?), SubResource ddosProtectionPlan = default(SubResource), string etag = default(string)) : base(id, name, type, location, tags) { AddressSpace = addressSpace; @@ -71,6 +74,7 @@ public VirtualNetwork() ProvisioningState = provisioningState; EnableDdosProtection = enableDdosProtection; EnableVmProtection = enableVmProtection; + DdosProtectionPlan = ddosProtectionPlan; Etag = etag; CustomInit(); } @@ -122,18 +126,26 @@ public VirtualNetwork() /// /// Gets or sets indicates if DDoS protection is enabled for all the - /// protected resources in a Virtual Network. + /// protected resources in the virtual network. It requires a DDoS + /// protection plan associated with the resource. /// [JsonProperty(PropertyName = "properties.enableDdosProtection")] public bool? EnableDdosProtection { get; set; } /// - /// Gets or sets indicates if Vm protection is enabled for all the - /// subnets in a Virtual Network. + /// Gets or sets indicates if VM protection is enabled for all the + /// subnets in the virtual network. /// [JsonProperty(PropertyName = "properties.enableVmProtection")] public bool? EnableVmProtection { get; set; } + /// + /// Gets or sets the DDoS protection plan associated with the virtual + /// network. + /// + [JsonProperty(PropertyName = "properties.ddosProtectionPlan")] + public SubResource DdosProtectionPlan { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs index c5d7bcdf9937..e8a608bab321 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientConfiguration.cs @@ -41,17 +41,20 @@ public VpnClientConfiguration() /// Virtual network gateway. /// VpnClientProtocols for Virtual /// network gateway. + /// VpnClientIpsecPolicies for + /// virtual network gateway P2S client. /// The radius server address /// property of the VirtualNetworkGateway resource for vpn client /// connection. /// The radius secret property of the /// VirtualNetworkGateway resource for vpn client connection. - public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList vpnClientProtocols = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string)) + public VpnClientConfiguration(AddressSpace vpnClientAddressPool = default(AddressSpace), IList vpnClientRootCertificates = default(IList), IList vpnClientRevokedCertificates = default(IList), IList vpnClientProtocols = default(IList), IList vpnClientIpsecPolicies = default(IList), string radiusServerAddress = default(string), string radiusServerSecret = default(string)) { VpnClientAddressPool = vpnClientAddressPool; VpnClientRootCertificates = vpnClientRootCertificates; VpnClientRevokedCertificates = vpnClientRevokedCertificates; VpnClientProtocols = vpnClientProtocols; + VpnClientIpsecPolicies = vpnClientIpsecPolicies; RadiusServerAddress = radiusServerAddress; RadiusServerSecret = radiusServerSecret; CustomInit(); @@ -88,6 +91,13 @@ public VpnClientConfiguration() [JsonProperty(PropertyName = "vpnClientProtocols")] public IList VpnClientProtocols { get; set; } + /// + /// Gets or sets vpnClientIpsecPolicies for virtual network gateway P2S + /// client. + /// + [JsonProperty(PropertyName = "vpnClientIpsecPolicies")] + public IList VpnClientIpsecPolicies { get; set; } + /// /// Gets or sets the radius server address property of the /// VirtualNetworkGateway resource for vpn client connection. diff --git a/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs new file mode 100644 index 000000000000..129fc3c4101a --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/VpnClientIPsecParameters.cs @@ -0,0 +1,171 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An IPSec parameters for a virtual network gateway P2S connection. + /// + public partial class VpnClientIPsecParameters + { + /// + /// Initializes a new instance of the VpnClientIPsecParameters class. + /// + public VpnClientIPsecParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VpnClientIPsecParameters class. + /// + /// The IPSec Security Association + /// (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S + /// client. + /// The IPSec Security Association + /// (also called Quick Mode or Phase 2 SA) payload size in KB for P2S + /// client.. + /// The IPSec encryption algorithm (IKE + /// phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + /// 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// The IPSec integrity algorithm (IKE + /// phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', + /// 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// The IKE encryption algorithm (IKE phase + /// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', + /// 'AES256', 'GCMAES256', 'GCMAES128' + /// The IKE integrity algorithm (IKE phase + /// 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', + /// 'GCMAES256', 'GCMAES128' + /// The DH Groups used in IKE Phase 1 for initial + /// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', + /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + /// The Pfs Groups used in IKE Phase 2 for new + /// child SA. Possible values include: 'None', 'PFS1', 'PFS2', + /// 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + public VpnClientIPsecParameters(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup) + { + SaLifeTimeSeconds = saLifeTimeSeconds; + SaDataSizeKilobytes = saDataSizeKilobytes; + IpsecEncryption = ipsecEncryption; + IpsecIntegrity = ipsecIntegrity; + IkeEncryption = ikeEncryption; + IkeIntegrity = ikeIntegrity; + DhGroup = dhGroup; + PfsGroup = pfsGroup; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the IPSec Security Association (also called Quick Mode + /// or Phase 2 SA) lifetime in seconds for P2S client. + /// + [JsonProperty(PropertyName = "saLifeTimeSeconds")] + public int SaLifeTimeSeconds { get; set; } + + /// + /// Gets or sets the IPSec Security Association (also called Quick Mode + /// or Phase 2 SA) payload size in KB for P2S client.. + /// + [JsonProperty(PropertyName = "saDataSizeKilobytes")] + public int SaDataSizeKilobytes { get; set; } + + /// + /// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible + /// values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', + /// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + /// + [JsonProperty(PropertyName = "ipsecEncryption")] + public string IpsecEncryption { get; set; } + + /// + /// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible + /// values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', + /// 'GCMAES256' + /// + [JsonProperty(PropertyName = "ipsecIntegrity")] + public string IpsecIntegrity { get; set; } + + /// + /// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible + /// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', + /// 'GCMAES256', 'GCMAES128' + /// + [JsonProperty(PropertyName = "ikeEncryption")] + public string IkeEncryption { get; set; } + + /// + /// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible + /// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', + /// 'GCMAES128' + /// + [JsonProperty(PropertyName = "ikeIntegrity")] + public string IkeIntegrity { get; set; } + + /// + /// Gets or sets the DH Groups used in IKE Phase 1 for initial SA. + /// Possible values include: 'None', 'DHGroup1', 'DHGroup2', + /// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + /// + [JsonProperty(PropertyName = "dhGroup")] + public string DhGroup { get; set; } + + /// + /// Gets or sets the Pfs Groups used in IKE Phase 2 for new child SA. + /// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + /// 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' + /// + [JsonProperty(PropertyName = "pfsGroup")] + public string PfsGroup { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IpsecEncryption == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpsecEncryption"); + } + if (IpsecIntegrity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpsecIntegrity"); + } + if (IkeEncryption == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IkeEncryption"); + } + if (IkeIntegrity == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IkeIntegrity"); + } + if (DhGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DhGroup"); + } + if (PfsGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PfsGroup"); + } + } + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs index 97f9388a2f76..358124bb43c4 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs index 5e1c26fe5164..fe9e254584bc 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs index 096ddf0be755..a2e2eff52cd9 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs @@ -119,7 +119,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1839,7 +1839,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2022,7 +2022,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2248,7 +2248,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2449,7 +2449,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2643,7 +2643,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs index 6204b02053a1..8cbb9c889f3f 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs @@ -82,6 +82,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IApplicationSecurityGroupsOperations ApplicationSecurityGroups { get; private set; } + /// + /// Gets the IDdosProtectionPlansOperations. + /// + public virtual IDdosProtectionPlansOperations DdosProtectionPlans { get; private set; } + /// /// Gets the IAvailableEndpointServicesOperations. /// @@ -97,6 +102,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IExpressRouteCircuitPeeringsOperations ExpressRouteCircuitPeerings { get; private set; } + /// + /// Gets the IExpressRouteCircuitConnectionsOperations. + /// + public virtual IExpressRouteCircuitConnectionsOperations ExpressRouteCircuitConnections { get; private set; } + /// /// Gets the IExpressRouteCircuitsOperations. /// @@ -107,6 +117,16 @@ public partial class NetworkManagementClient : ServiceClient public virtual IExpressRouteServiceProvidersOperations ExpressRouteServiceProviders { get; private set; } + /// + /// Gets the IExpressRouteCrossConnectionsOperations. + /// + public virtual IExpressRouteCrossConnectionsOperations ExpressRouteCrossConnections { get; private set; } + + /// + /// Gets the IExpressRouteCrossConnectionPeeringsOperations. + /// + public virtual IExpressRouteCrossConnectionPeeringsOperations ExpressRouteCrossConnectionPeerings { get; private set; } + /// /// Gets the ILoadBalancersOperations. /// @@ -460,11 +480,15 @@ private void Initialize() { ApplicationGateways = new ApplicationGatewaysOperations(this); ApplicationSecurityGroups = new ApplicationSecurityGroupsOperations(this); + DdosProtectionPlans = new DdosProtectionPlansOperations(this); AvailableEndpointServices = new AvailableEndpointServicesOperations(this); ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); + ExpressRouteCircuitConnections = new ExpressRouteCircuitConnectionsOperations(this); ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); ExpressRouteServiceProviders = new ExpressRouteServiceProvidersOperations(this); + ExpressRouteCrossConnections = new ExpressRouteCrossConnectionsOperations(this); + ExpressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsOperations(this); LoadBalancers = new LoadBalancersOperations(this); LoadBalancerBackendAddressPools = new LoadBalancerBackendAddressPoolsOperations(this); LoadBalancerFrontendIPConfigurations = new LoadBalancerFrontendIPConfigurationsOperations(this); @@ -575,7 +599,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs index 65734359fa8f..d56f44d04d55 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkSecurityGroupsOperations.cs @@ -119,7 +119,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -356,7 +356,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -728,7 +728,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1139,7 +1139,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs index ce114ba7f0c2..859b9796ac95 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkWatchersOperations.cs @@ -101,7 +101,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +320,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -543,7 +543,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +737,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -915,7 +915,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1112,7 +1112,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1565,7 +1565,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1753,7 +1753,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1983,7 +1983,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2213,7 +2213,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2443,7 +2443,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2673,7 +2673,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2903,7 +2903,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3133,7 +3133,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3365,7 +3365,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3596,7 +3596,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3823,7 +3823,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/Operations.cs b/src/SDKs/Network/Management.Network/Generated/Operations.cs index 90e49fc3f7f4..7a03d117dd72 100644 --- a/src/SDKs/Network/Management.Network/Generated/Operations.cs +++ b/src/SDKs/Network/Management.Network/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs index 57341674bdf1..6c51c9f48d9c 100644 --- a/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/PacketCapturesOperations.cs @@ -129,7 +129,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -400,7 +400,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -612,7 +612,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -819,7 +819,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1001,7 +1001,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1186,7 +1186,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs b/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs index 73c99fcd8f66..5b6e94d8c1b7 100644 --- a/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/PublicIpAddressesOperations.cs @@ -119,7 +119,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1381,7 +1381,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1564,7 +1564,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1790,7 +1790,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs index 95669be706ca..4bf26d6f00c6 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteFilterRulesOperations.cs @@ -126,7 +126,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -378,7 +378,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -576,7 +576,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -772,7 +772,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1007,7 +1007,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs index 387bfcf14630..00b1ca5858ff 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteFiltersOperations.cs @@ -119,7 +119,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +726,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs index 6325c73de766..6bb0f5462724 100644 --- a/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RouteTablesOperations.cs @@ -119,7 +119,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -361,7 +361,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -726,7 +726,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1135,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs b/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs index e21b0dc96fde..eed42a00224a 100644 --- a/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/RoutesOperations.cs @@ -126,7 +126,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs index 447b34cd53e6..af34e9cdb560 100644 --- a/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/SdkInfo_NetworkManagementClient.cs @@ -13,44 +13,48 @@ public static IEnumerable> ApiInfo_NetworkManageme { new Tuple("Compute", "NetworkInterfaces", "2017-03-30"), new Tuple("Compute", "PublicIPAddresses", "2017-03-30"), - new Tuple("Network", "ApplicationGateways", "2018-01-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2018-01-01"), - new Tuple("Network", "AvailableEndpointServices", "2018-01-01"), - new Tuple("Network", "BgpServiceCommunities", "2018-01-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2018-01-01"), - new Tuple("Network", "ConnectionMonitors", "2018-01-01"), - new Tuple("Network", "DefaultSecurityRules", "2018-01-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2018-01-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2018-01-01"), - new Tuple("Network", "ExpressRouteCircuits", "2018-01-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2018-01-01"), - new Tuple("Network", "InboundNatRules", "2018-01-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2018-01-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2018-01-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2018-01-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2018-01-01"), - new Tuple("Network", "LoadBalancerProbes", "2018-01-01"), - new Tuple("Network", "LoadBalancers", "2018-01-01"), - new Tuple("Network", "LocalNetworkGateways", "2018-01-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2018-01-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2018-01-01"), - new Tuple("Network", "NetworkInterfaces", "2018-01-01"), - new Tuple("Network", "NetworkSecurityGroups", "2018-01-01"), - new Tuple("Network", "NetworkWatchers", "2018-01-01"), - new Tuple("Network", "Operations", "2018-01-01"), - new Tuple("Network", "PacketCaptures", "2018-01-01"), - new Tuple("Network", "PublicIPAddresses", "2018-01-01"), - new Tuple("Network", "RouteFilterRules", "2018-01-01"), - new Tuple("Network", "RouteFilters", "2018-01-01"), - new Tuple("Network", "RouteTables", "2018-01-01"), - new Tuple("Network", "Routes", "2018-01-01"), - new Tuple("Network", "SecurityRules", "2018-01-01"), - new Tuple("Network", "Subnets", "2018-01-01"), - new Tuple("Network", "Usages", "2018-01-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2018-01-01"), - new Tuple("Network", "VirtualNetworkGateways", "2018-01-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2018-01-01"), - new Tuple("Network", "VirtualNetworks", "2018-01-01"), + new Tuple("Network", "ApplicationGateways", "2018-02-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2018-02-01"), + new Tuple("Network", "AvailableEndpointServices", "2018-02-01"), + new Tuple("Network", "BgpServiceCommunities", "2018-02-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2018-02-01"), + new Tuple("Network", "ConnectionMonitors", "2018-02-01"), + new Tuple("Network", "DdosProtectionPlans", "2018-02-01"), + new Tuple("Network", "DefaultSecurityRules", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2018-02-01"), + new Tuple("Network", "ExpressRouteCircuits", "2018-02-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2018-02-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2018-02-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2018-02-01"), + new Tuple("Network", "InboundNatRules", "2018-02-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2018-02-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2018-02-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2018-02-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2018-02-01"), + new Tuple("Network", "LoadBalancerProbes", "2018-02-01"), + new Tuple("Network", "LoadBalancers", "2018-02-01"), + new Tuple("Network", "LocalNetworkGateways", "2018-02-01"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2018-02-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2018-02-01"), + new Tuple("Network", "NetworkInterfaces", "2018-02-01"), + new Tuple("Network", "NetworkSecurityGroups", "2018-02-01"), + new Tuple("Network", "NetworkWatchers", "2018-02-01"), + new Tuple("Network", "Operations", "2018-02-01"), + new Tuple("Network", "PacketCaptures", "2018-02-01"), + new Tuple("Network", "PublicIPAddresses", "2018-02-01"), + new Tuple("Network", "RouteFilterRules", "2018-02-01"), + new Tuple("Network", "RouteFilters", "2018-02-01"), + new Tuple("Network", "RouteTables", "2018-02-01"), + new Tuple("Network", "Routes", "2018-02-01"), + new Tuple("Network", "SecurityRules", "2018-02-01"), + new Tuple("Network", "Subnets", "2018-02-01"), + new Tuple("Network", "Usages", "2018-02-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2018-02-01"), + new Tuple("Network", "VirtualNetworkGateways", "2018-02-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2018-02-01"), + new Tuple("Network", "VirtualNetworks", "2018-02-01"), }.AsEnumerable(); } } diff --git a/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs b/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs index a6a00f7a4814..bc067f6810ec 100644 --- a/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/SecurityRulesOperations.cs @@ -126,7 +126,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs b/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs index 4f7ad531c368..c61d32ede693 100644 --- a/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/SubnetsOperations.cs @@ -129,7 +129,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -358,7 +358,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -748,7 +748,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs b/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs index 848b7576bd9a..11e00497612d 100644 --- a/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/UsagesOperations.cs @@ -94,7 +94,7 @@ internal UsagesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs index 6d6ce6b16e46..af1fddad2d66 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -121,7 +121,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -393,7 +393,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -581,7 +581,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -815,7 +815,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1031,7 +1031,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1214,7 +1214,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1430,7 +1430,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1664,7 +1664,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs index 062390cb277d..b0e99773c1ef 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperations.cs @@ -120,7 +120,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -870,7 +870,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1069,6 +1069,58 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of 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. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> SetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Gets a xml format representation for vpn device configuration script. /// @@ -1121,7 +1173,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1330,7 +1382,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1546,7 +1598,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1729,7 +1781,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1935,7 +1987,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2143,7 +2195,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2353,7 +2405,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2556,7 +2608,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2753,7 +2805,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2953,7 +3005,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3155,7 +3207,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3310,6 +3362,417 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) return _result; } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of 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. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client 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> BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, 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 (vpnclientIpsecParams == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vpnclientIpsecParams"); + } + if (vpnclientIpsecParams != null) + { + vpnclientIpsecParams.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("vpnclientIpsecParams", vpnclientIpsecParams); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSetVpnclientIpsecParameters", tracingParameters); + } + // Construct URL + 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}/setvpnclientipsecparameters").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(vpnclientIpsecParams != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vpnclientIpsecParams, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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 Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway 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> BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, 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 (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2018-02-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginGetVpnclientIpsecParameters", tracingParameters); + } + // Construct URL + 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}/getvpnclientipsecparameters").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + 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 (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + 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 (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; + } + /// /// Gets all virtual network gateways by resource group. /// diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs index 133ac189a623..04326f7b444e 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkGatewaysOperationsExtensions.cs @@ -636,6 +636,102 @@ public static GatewayRouteListResult GetAdvertisedRoutes(this IVirtualNetworkGat } } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + public static VpnClientIPsecParameters SetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) + { + return operations.SetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); + } + + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// The cancellation token. + /// + public static async Task SetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + public static VpnClientIPsecParameters GetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return operations.GetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The cancellation token. + /// + public static async Task GetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets a xml format representation for vpn device configuration script. /// @@ -1145,6 +1241,102 @@ public static GatewayRouteListResult BeginGetAdvertisedRoutes(this IVirtualNetwo } } + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + public static VpnClientIPsecParameters BeginSetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams) + { + return operations.BeginSetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams).GetAwaiter().GetResult(); + } + + /// + /// The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy + /// for P2S client of virtual network gateway in the specified resource group + /// through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network gateway. + /// + /// + /// Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual + /// Network Gateway P2S client operation through Network resource provider. + /// + /// + /// The cancellation token. + /// + public static async Task BeginSetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, VpnClientIPsecParameters vpnclientIpsecParams, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginSetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + public static VpnClientIPsecParameters BeginGetVpnclientIpsecParameters(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return operations.BeginGetVpnclientIpsecParametersAsync(resourceGroupName, virtualNetworkGatewayName).GetAwaiter().GetResult(); + } + + /// + /// The Get VpnclientIpsecParameters operation retrieves information about the + /// vpnclient ipsec policy for P2S client of virtual network gateway in the + /// specified resource group through Network resource provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The virtual network gateway name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetVpnclientIpsecParametersAsync(this IVirtualNetworkGatewaysOperations operations, string resourceGroupName, string virtualNetworkGatewayName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetVpnclientIpsecParametersWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets all virtual network gateways by resource group. /// diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs index 8285a814144f..2af2065f01e8 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworkPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -742,7 +742,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs b/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs index ead7a93f6542..f706310687aa 100644 --- a/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/VirtualNetworksOperations.cs @@ -119,7 +119,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -732,7 +732,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -931,7 +931,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1122,7 +1122,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1305,7 +1305,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1531,7 +1531,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-01-01"; + string apiVersion = "2018-02-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj b/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj index 1e8ddfd42d00..e43ad8985547 100644 --- a/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj +++ b/src/SDKs/Network/Management.Network/Microsoft.Azure.Management.Network.csproj @@ -7,13 +7,16 @@ Microsoft.Azure.Management.Network Provides management capabilities for Network services. Microsoft.Azure.Management.Network - 17.0.0-preview + 18.0.0-preview Microsoft Azure Network management;Network;Network management; + - DDoS Protection Plans + - Express Route Circuit Connection + - Express Route Provider APIs + - GetTopologyOperation supports query parameter + - Custom IPsec/IKE policy for Virtual Network Gateway point-to-site clients + ]]> net452;netstandard1.4 diff --git a/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs b/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs index dfe47c1e5a86..be64a1496f44 100644 --- a/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs +++ b/src/SDKs/Network/Management.Network/Properties/AssemblyInfo.cs @@ -7,8 +7,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("17.0.0.0")] -[assembly: AssemblyFileVersion("17.0.0.0")] +[assembly: AssemblyVersion("18.0.0.0")] +[assembly: AssemblyFileVersion("18.0.0.0")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/src/SDKs/Network/Management.Network/generate.ps1 b/src/SDKs/Network/Management.Network/generate.ps1 new file mode 100644 index 000000000000..30d92029fb51 --- /dev/null +++ b/src/SDKs/Network/Management.Network/generate.ps1 @@ -0,0 +1 @@ +powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File "$(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)\..\..\..\..\tools\generateTool.ps1" -ResourceProvider "network/resource-manager" -PowershellInvoker -AutoRestVersion "latest" \ No newline at end of file diff --git a/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs b/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs index ec45fb55a4ee..f0990fb2202b 100644 --- a/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs +++ b/src/SDKs/Network/Network.Tests/Tests/TestHelper.cs @@ -54,8 +54,8 @@ public static ExpressRouteCircuit UpdateDefaultExpressRouteCircuitWithMicrosoftP { var peering = new ExpressRouteCircuitPeering() { - Name = ExpressRouteCircuitPeeringType.MicrosoftPeering.ToString(), - PeeringType = ExpressRouteCircuitPeeringType.MicrosoftPeering, + Name = ExpressRoutePeeringType.MicrosoftPeering.ToString(), + PeeringType = ExpressRoutePeeringType.MicrosoftPeering, PeerASN = Convert.ToInt32(ExpressRouteTests.MS_PeerASN), VlanId = Convert.ToInt32(ExpressRouteTests.MS_VlanId), PrimaryPeerAddressPrefix = ExpressRouteTests.MS_PrimaryPrefix, @@ -97,8 +97,8 @@ public static ExpressRouteCircuit UpdateDefaultExpressRouteCircuitWithIpv6Micros var peering = new ExpressRouteCircuitPeering() { - Name = ExpressRouteCircuitPeeringType.MicrosoftPeering.ToString(), - PeeringType = ExpressRouteCircuitPeeringType.MicrosoftPeering, + Name = ExpressRoutePeeringType.MicrosoftPeering.ToString(), + PeeringType = ExpressRoutePeeringType.MicrosoftPeering, PeerASN = Convert.ToInt32(ExpressRouteTests.MS_PeerASN), VlanId = Convert.ToInt32(ExpressRouteTests.MS_VlanId), Ipv6PeeringConfig = ipv6Peering @@ -118,8 +118,8 @@ public static ExpressRouteCircuit UpdateDefaultExpressRouteCircuitWithMicrosoftP var peering = new ExpressRouteCircuitPeering() { - Name = ExpressRouteCircuitPeeringType.MicrosoftPeering.ToString(), - PeeringType = ExpressRouteCircuitPeeringType.MicrosoftPeering, + Name = ExpressRoutePeeringType.MicrosoftPeering.ToString(), + PeeringType = ExpressRoutePeeringType.MicrosoftPeering, PeerASN = Convert.ToInt32(ExpressRouteTests.MS_PeerASN), PrimaryPeerAddressPrefix = ExpressRouteTests.MS_PrimaryPrefix, SecondaryPeerAddressPrefix = ExpressRouteTests.MS_SecondaryPrefix, diff --git a/src/SDKs/_metadata/network_resource-manager.txt b/src/SDKs/_metadata/network_resource-manager.txt index 3f5cbe29faac..35a91736c956 100644 --- a/src/SDKs/_metadata/network_resource-manager.txt +++ b/src/SDKs/_metadata/network_resource-manager.txt @@ -1,11 +1,17 @@ -2018-02-01 07:45:40 UTC - +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/readme.md --csharp --csharp-sdks-folder=D:\azure-sdk-for-net\tools\..\src\SDKs\ --version=latest --reflect-api-versions +2018-04-02 23:15:52 UTC 1) azure-rest-api-specs repository information -GitHub user: Azure +GitHub fork: Azure Branch: master -Commit: ac3f87ab0554ddf7fbc418d29bc02fbc30d384f3 +Commit: 64122e98211412bc22f81f40b7460c92452ecab9 2) AutoRest information Requested version: latest -Bootstrapper version: D:\nvm\v7.10.0 `-- autorest@2.0.4245 +Bootstrapper version: C:\Users\murocha\AppData\Roaming\npm +-- autorest@2.0.4262 `-- oad@0.1.7 `-- autorest@1.2.2 + + Latest installed version: +.\tools\generate.ps1 was invoked by generate.ps1 + +